Class: ActiveSearch::Result
- Inherits:
-
Hash
- Object
- Hash
- ActiveSearch::Result
- Defined in:
- lib/activesearch/result.rb
Instance Method Summary collapse
-
#initialize(result) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(result) ⇒ Result
Returns a new instance of Result.
3 4 5 6 7 8 9 |
# File 'lib/activesearch/result.rb', line 3 def initialize(result) result.to_hash.each do |k,v| unless v.nil? self[k.to_s] = v.respond_to?(:has_key?) && v.has_key?(I18n.locale.to_s) ? v[I18n.locale.to_s] : v end end end |