Class: CatalogAPI::Fulfillment
- Inherits:
-
Object
- Object
- CatalogAPI::Fulfillment
- Defined in:
- lib/catalogapi/fulfillment.rb
Instance Attribute Summary collapse
-
#fulfillment_date ⇒ Object
readonly
Returns the value of attribute fulfillment_date.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Fulfillment
constructor
A new instance of Fulfillment.
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_date ⇒ Object (readonly)
Returns the value of attribute fulfillment_date.
5 6 7 |
# File 'lib/catalogapi/fulfillment.rb', line 5 def fulfillment_date @fulfillment_date end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/catalogapi/fulfillment.rb', line 5 def items @items end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/catalogapi/fulfillment.rb', line 5 def @metadata end |