Class: BudaApi::Models::OrderPages

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/buda_api/models.rb

Overview

Paginated collection of orders

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#raw, #to_h, #to_json

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
  @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