Class: DataMapper::Adapters::Sphinx::Collection
- Inherits:
-
Array
- Object
- Array
- DataMapper::Adapters::Sphinx::Collection
- Defined in:
- lib/dm-sphinx-adapter/collection.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#time ⇒ Object
Returns the value of attribute time.
-
#total ⇒ Object
Returns the value of attribute total.
-
#words ⇒ Object
Returns the value of attribute words.
Instance Method Summary collapse
-
#initialize(result) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(result) ⇒ Collection
Returns a new instance of Collection.
7 8 9 10 11 12 13 14 |
# File 'lib/dm-sphinx-adapter/collection.rb', line 7 def initialize(result) # TODO: One liner that works in Ruby 1.x now #indexes is #keys? @error = result[:error] @time = result[:time] @total = result[:total] @words = result[:words] super result[:matches].map{|doc| doc[:id] = doc[:doc]; doc} end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
5 6 7 |
# File 'lib/dm-sphinx-adapter/collection.rb', line 5 def error @error end |
#time ⇒ Object
Returns the value of attribute time.
5 6 7 |
# File 'lib/dm-sphinx-adapter/collection.rb', line 5 def time @time end |
#total ⇒ Object
Returns the value of attribute total.
5 6 7 |
# File 'lib/dm-sphinx-adapter/collection.rb', line 5 def total @total end |
#words ⇒ Object
Returns the value of attribute words.
5 6 7 |
# File 'lib/dm-sphinx-adapter/collection.rb', line 5 def words @words end |