Class: Portage::Ucp::FulfillmentOption
- Inherits:
-
Data
- Object
- Data
- Portage::Ucp::FulfillmentOption
- Defined in:
- lib/portage/ucp/value_objects.rb
Overview
schemas/shopping/types/fulfillment_option.json — a single priced choice within a FulfillmentGroup (e.g. "Standard Shipping $5", "Express $15").
Instance Attribute Summary collapse
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#earliest_fulfillment_time ⇒ Object
readonly
Returns the value of attribute earliest_fulfillment_time.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#latest_fulfillment_time ⇒ Object
readonly
Returns the value of attribute latest_fulfillment_time.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#totals ⇒ Object
readonly
Returns the value of attribute totals.
Instance Method Summary collapse
-
#initialize(id:, title:, totals:, description: nil, carrier: nil, earliest_fulfillment_time: nil, latest_fulfillment_time: nil) ⇒ FulfillmentOption
constructor
A new instance of FulfillmentOption.
- #to_wire_h ⇒ Object
Constructor Details
#initialize(id:, title:, totals:, description: nil, carrier: nil, earliest_fulfillment_time: nil, latest_fulfillment_time: nil) ⇒ FulfillmentOption
Returns a new instance of FulfillmentOption.
277 278 279 280 |
# File 'lib/portage/ucp/value_objects.rb', line 277 def initialize(id:, title:, totals:, description: nil, carrier: nil, earliest_fulfillment_time: nil, latest_fulfillment_time: nil) super end |
Instance Attribute Details
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def carrier @carrier end |
#description ⇒ Object (readonly)
Returns the value of attribute description
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def description @description end |
#earliest_fulfillment_time ⇒ Object (readonly)
Returns the value of attribute earliest_fulfillment_time
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def earliest_fulfillment_time @earliest_fulfillment_time end |
#id ⇒ Object (readonly)
Returns the value of attribute id
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def id @id end |
#latest_fulfillment_time ⇒ Object (readonly)
Returns the value of attribute latest_fulfillment_time
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def latest_fulfillment_time @latest_fulfillment_time end |
#title ⇒ Object (readonly)
Returns the value of attribute title
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def title @title end |
#totals ⇒ Object (readonly)
Returns the value of attribute totals
275 276 277 |
# File 'lib/portage/ucp/value_objects.rb', line 275 def totals @totals end |
Instance Method Details
#to_wire_h ⇒ Object
282 283 284 285 286 287 288 289 |
# File 'lib/portage/ucp/value_objects.rb', line 282 def to_wire_h h = { "id" => id, "title" => title, "totals" => totals.map(&:to_wire_h) } h["description"] = description if description h["carrier"] = carrier if carrier h["earliest_fulfillment_time"] = earliest_fulfillment_time if earliest_fulfillment_time h["latest_fulfillment_time"] = latest_fulfillment_time if latest_fulfillment_time h end |