Class: Dillo::Page
- Inherits:
-
Collection
- Object
- Base
- Collection
- Dillo::Page
- Defined in:
- lib/dillo.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#number ⇒ Object
Returns the value of attribute number.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(collection, number) ⇒ Page
constructor
A new instance of Page.
- #path ⇒ Object
- #prepare_request(request) ⇒ Object
- #record_class ⇒ Object
Methods inherited from Collection
#create_record, #each, #record_attributes, #records
Methods included from Finders
#[], #method_missing, #respond_to?
Methods inherited from Base
Constructor Details
#initialize(collection, number) ⇒ Page
Returns a new instance of Page.
147 148 149 150 151 |
# File 'lib/dillo.rb', line 147 def initialize(collection, number) @collection = collection @number = number super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dillo::Finders
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
145 146 147 |
# File 'lib/dillo.rb', line 145 def collection @collection end |
#number ⇒ Object
Returns the value of attribute number.
145 146 147 |
# File 'lib/dillo.rb', line 145 def number @number end |
Instance Method Details
#path ⇒ Object
153 154 155 |
# File 'lib/dillo.rb', line 153 def path collection.path end |
#prepare_request(request) ⇒ Object
161 162 163 164 |
# File 'lib/dillo.rb', line 161 def prepare_request(request) request.params['limit'] = 200 request.params['page'] = @number end |
#record_class ⇒ Object
157 158 159 |
# File 'lib/dillo.rb', line 157 def record_class collection.record_class end |