Class: Windy::Page

Inherits:
Collection show all
Defined in:
lib/windy.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#connection

Instance Method Summary collapse

Methods inherited from Collection

#create_record, #each, #record_attributes, #records

Methods included from Finders

#[], #method_missing, #respond_to?

Methods inherited from Base

#body, #inspect, #json, root

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

#collectionObject

Returns the value of attribute collection.



144
145
146
# File 'lib/windy.rb', line 144

def collection
  @collection
end

#numberObject

Returns the value of attribute number.



144
145
146
# File 'lib/windy.rb', line 144

def number
  @number
end

Instance Method Details

#pathObject



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_classObject



156
157
158
# File 'lib/windy.rb', line 156

def record_class
  collection.record_class
end