Class: BudaApi::Models::OrderPages
- Defined in:
- lib/buda_api/models.rb
Overview
Paginated collection of orders
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#orders ⇒ Object
readonly
Returns the value of attribute orders.
Instance Method Summary collapse
- #count ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(orders_data, meta_data) ⇒ OrderPages
constructor
A new instance of OrderPages.
Methods inherited from BaseModel
Constructor Details
#initialize(orders_data, meta_data) ⇒ OrderPages
Returns a new instance of OrderPages.
323 324 325 326 |
# File 'lib/buda_api/models.rb', line 323 def initialize(orders_data, ) @orders = orders_data.map { |order| Order.new(order) } @meta = PaginationMeta.new( || {}) end |
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
328 329 330 |
# File 'lib/buda_api/models.rb', line 328 def @meta end |
#orders ⇒ Object (readonly)
Returns the value of attribute orders.
328 329 330 |
# File 'lib/buda_api/models.rb', line 328 def orders @orders end |
Instance Method Details
#count ⇒ Object
330 331 332 |
# File 'lib/buda_api/models.rb', line 330 def count @orders.length end |
#each(&block) ⇒ Object
334 335 336 |
# File 'lib/buda_api/models.rb', line 334 def each(&block) @orders.each(&block) end |