Class: Windy::Page
- Inherits:
-
Collection
- Object
- Base
- Collection
- Windy::Page
- Defined in:
- lib/windy.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.
146 147 148 149 150 |
# File 'lib/windy.rb', line 146 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 Windy::Finders
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
144 145 146 |
# File 'lib/windy.rb', line 144 def collection @collection end |
#number ⇒ Object
Returns the value of attribute number.
144 145 146 |
# File 'lib/windy.rb', line 144 def number @number end |
Instance Method Details
#path ⇒ Object
152 153 154 |
# File 'lib/windy.rb', line 152 def path collection.path end |
#prepare_request(request) ⇒ Object
160 161 162 163 |
# File 'lib/windy.rb', line 160 def prepare_request(request) request.params['limit'] = 200 request.params['page'] = @number end |
#record_class ⇒ Object
156 157 158 |
# File 'lib/windy.rb', line 156 def record_class collection.record_class end |