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.



134
135
136
137
138
# File 'lib/windy.rb', line 134

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.



132
133
134
# File 'lib/windy.rb', line 132

def collection
  @collection
end

#numberObject

Returns the value of attribute number.



132
133
134
# File 'lib/windy.rb', line 132

def number
  @number
end

Instance Method Details

#pathObject



140
141
142
# File 'lib/windy.rb', line 140

def path
  collection.path
end

#prepare_request(request) ⇒ Object



148
149
150
151
# File 'lib/windy.rb', line 148

def prepare_request(request)
  request.params['limit'] = 200
  request.params['page'] = @number
end

#record_classObject



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

def record_class
  collection.record_class
end