Build a Hash with the default filters.

 @return [Hash, NilClass]

 @api public
503981
def filter_params
      @_filter_params ||=
        case params[:filter]
        when Hash, ActionController::Parameters
          default_filters.each_with_object({}) do |field, hash|
            unformatted_field = @request.unformat_key(field)
            hash[unformatted_field] = params[:filter][field]
          end
        end
    end
79156
def to_hash
      {
        :installer => installer,
        :installer_arguments => installer_arguments,
        :iso_path => iso_path,
        :iso_upload_path => iso_upload_path,
        :iso_mount_point => iso_mount_point,
        :auto_update => auto_update,
        :auto_reboot => auto_reboot,
        :no_install => no_install,
        :no_remote => no_remote,
        :yes => yes
      }
    end
457958
def flat_hash(hash, keys = [])
      new_hash = {}

      hash.each do |key, val|
        new_hash[format_key(keys + [key])] = val unless
          val.is_a?(Array) || val.is_a?(Hash)
        new_hash.merge!(flat_hash(val, keys + [key])) if val.is_a? Hash

        if val.is_a? Array
          val.each do |v|
            if v.is_a? Hash
              new_hash.merge!(flat_hash(v, keys + [key])) do |key, f, s|
                Array(f) << s
              end
            else
              formatted_key = format_key(keys + [key])
              new_hash[formatted_key] =
                new_hash[formatted_key] ? (Array(new_hash[formatted_key]) << v) : v
            end
          end
        end
      end

      new_hash
    end
125047
def to_hash
      Hash[options.reject(&:null?).map { |o| [o.key, o.value] }]
    end
707796
def to_hash
      Hash.new.tap do |hash|
        @child_options.each do |name, opt|
          # this is meant to be a "value exporter", so always use distinct values
          # on the returned hash to prevent unintentional pass-by-ref shared objects
          hash[name.to_sym] = NsOptions.distinct_value(opt.value)
        end
        @child_namespaces.each{|name, value| hash[name.to_sym] = value.to_hash}
      end
    end
288115
def to_hash
    self.instance_variables.inject({}) { |m,v| m[v[1,v.length].to_sym] = instance_variable_get(v); m }
  end
1320796
def parse_hash(hash, convert_types = false)
      new_hash = {}
      hash.each do |k, v|
        if convert_types
          v = v.to_i if v && v.match(/^\d+$/)
          v = true if v == 'true'
          v = false if v == 'false'
          v = nil if v == 'nil'
        end
        if k =~ /\./
          sub_hash = new_hash
          split = k.split('.')
          split.each do |sub_key|
            if sub_key == split.last
              sub_hash[sub_key] = v
            else
              sub_hash[sub_key] ||= {}
              sub_hash = sub_hash[sub_key]
            end
          end
          new_hash[split.first] ||= {}
        else
          new_hash[k] = v
        end
      end
      new_hash
    end
498505
def build(self):
        
        if self.es_version == '1':
            if len(self.filters) > 0:
                return {
                    'filtered': {
                        'query': self.query,
                        'filter': {
                            'and': self.filters
                        }
                    }
                }
            else:
                return self.query
        else:
            query = {
                'bool': {
                    'must': self.query
                }
            }
            if len(self.filters) > 0:
                query["bool"]["filter"] = self.filters
            return query
931391
def default data_hash, &block
    raise ArgumentError.new("Hash required") unless data_hash.kind_of? Hash

    obj = self.dup
    obj.instance_variable_set :@query_default, @query_default.merge(data_hash)
    ret obj, &block
  end
306915
def defaults
      @values = Hash[self.class.options.select { |_, c| c.key?(:default) }.map { |n,c| [n, c[:default]] }].merge(@values)
    end
329760
def to_hash(args = {}) # :nodoc:
      args ||= {}

      if args[:nested]
        {'url' => self[:@url] || self[:url]}
      else
        hash = super
        hash.merge!('@version' => self['@version']) unless new_record?
        {self.class.json_name => hash}
      end
    end
905245
def build(option_hash)
      opts = option_hash.dup || {}
      @relation = @base.scoped
      opts.stringify_keys!
      opts = collapse_multiparameter_options(opts)
      assign_attributes(opts)
      self
    end
1130370
def indifferent_hash
      Hash.new {|hash,key| hash[key.to_sym] if String === key }
    end
727679
def to_hash()
      rethash = {
        "permissions" => @permissions
      }
      (@user.attributes - [:links]).each do |attr_sym|
        rethash[attr_sym.to_s] = @user.send(attr_sym.to_s)
      end
      rethash
    end
1317933
def convert(*filters)
      filters = filters.flatten.map { |f| Filters.resolve!(f) }

      entries.each_value do |entry|
        entry.convert!(*filters) if !block_given? || yield(entry)
      end

      self
    end
57221
def create_versions_hash
      hash = Hash.new { |h, k| h[k] = [] }

      versions.each do |version|
        hash[version[0]] << version
      end

      hash
    end
1211102
def map_query_filters(filters)
      Hash[filters.map do |key, value|
        case value
        when Hash then
          if value.key? :any then format_query_filter('$in', key, value[:any])
          elsif value.key? :all then format_query_filter('$all', key, value[:all])
          else raise UnknownFilterQueryOperator, value.keys.join(','), caller end
        else format_query_filter('$all', key, value)
        end
      end]
    end