Class: Oedipus::DataMapper::Collection
- Inherits:
-
DataMapper::Collection
- Object
- DataMapper::Collection
- Oedipus::DataMapper::Collection
- Defined in:
- lib/oedipus/data_mapper/collection.rb
Overview
Adds some additional methods to DataMapper::Collection to provide meta data.
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#docs ⇒ Object
readonly
Returns the value of attribute docs.
-
#facets ⇒ Object
readonly
Returns the value of attribute facets.
-
#keywords ⇒ Object
readonly
Returns the value of attribute keywords.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#total_found ⇒ Object
readonly
Returns the value of attribute total_found.
Instance Method Summary collapse
-
#initialize(query, records = nil, options = {}) ⇒ Collection
constructor
Initialize a new Collection for the given query and records.
Constructor Details
#initialize(query, records = nil, options = {}) ⇒ Collection
Initialize a new Collection for the given query and records.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/oedipus/data_mapper/collection.rb', line 40 def initialize(query, records = nil, = {}) super(query, records) @time = [:time] @total_found = [:total_found] @count = [:count] @keywords = [:keywords] @docs = [:docs] @facets = .fetch(:facets, {}) @pager = [:pager] end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
16 17 18 |
# File 'lib/oedipus/data_mapper/collection.rb', line 16 def count @count end |
#docs ⇒ Object (readonly)
Returns the value of attribute docs.
19 20 21 |
# File 'lib/oedipus/data_mapper/collection.rb', line 19 def docs @docs end |
#facets ⇒ Object (readonly)
Returns the value of attribute facets.
17 18 19 |
# File 'lib/oedipus/data_mapper/collection.rb', line 17 def facets @facets end |
#keywords ⇒ Object (readonly)
Returns the value of attribute keywords.
18 19 20 |
# File 'lib/oedipus/data_mapper/collection.rb', line 18 def keywords @keywords end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
14 15 16 |
# File 'lib/oedipus/data_mapper/collection.rb', line 14 def time @time end |
#total_found ⇒ Object (readonly)
Returns the value of attribute total_found.
15 16 17 |
# File 'lib/oedipus/data_mapper/collection.rb', line 15 def total_found @total_found end |