class ThinkingSphinx::FacetSearch::Filter

Public Class Methods

new(facets, hash) click to toggle source
# File lib/thinking_sphinx/facet_search.rb, line 126
def initialize(facets, hash)
  @facets, @hash = facets, hash
end

Public Instance Methods

to_hash() click to toggle source
# File lib/thinking_sphinx/facet_search.rb, line 130
def to_hash
  @hash.keys.inject({}) { |options, key|
    type = @facets.detect { |facet| facet.name == key.to_s }.filter_type
    options[type] ||= {}
    options[type][key] = @hash[key]
    options
  }
end