Class: CatalogAPI::Fulfillment

Inherits:
Object
  • Object
show all
Defined in:
lib/catalogapi/fulfillment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Fulfillment

Returns a new instance of Fulfillment.



6
7
8
9
10
# File 'lib/catalogapi/fulfillment.rb', line 6

def initialize(opts)
  @fulfillment_date = opts[:fulfillment_date]
  @items = opts.dig(:items, :FulfillmentItem).to_a.map { |i| CatalogAPI::OrderItem.new(i) }
  @metadata = opts.dig(:metadata, :Meta).to_a.map { |i| CatalogAPI::Metadata.new(i) }
end

Instance Attribute Details

#fulfillment_dateObject (readonly)

Returns the value of attribute fulfillment_date.



5
6
7
# File 'lib/catalogapi/fulfillment.rb', line 5

def fulfillment_date
  @fulfillment_date
end

#itemsObject (readonly)

Returns the value of attribute items.



5
6
7
# File 'lib/catalogapi/fulfillment.rb', line 5

def items
  @items
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5
6
7
# File 'lib/catalogapi/fulfillment.rb', line 5

def 
  @metadata
end