Class: MusicTodayApiWrapper::Resources::Checkout::Destination
- Inherits:
-
Object
- Object
- MusicTodayApiWrapper::Resources::Checkout::Destination
- Defined in:
- lib/resources/checkout/destination.rb
Instance Attribute Summary collapse
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#shipping_cost ⇒ Object
Returns the value of attribute shipping_cost.
-
#shipping_option ⇒ Object
Returns the value of attribute shipping_option.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(customer, shipping_option = '', shipping_cost = 0.0) ⇒ Destination
constructor
A new instance of Destination.
Constructor Details
#initialize(customer, shipping_option = '', shipping_cost = 0.0) ⇒ Destination
Returns a new instance of Destination.
10 11 12 13 14 |
# File 'lib/resources/checkout/destination.rb', line 10 def initialize(customer, shipping_option = '', shipping_cost = 0.0) @customer = customer @shipping_option = shipping_option @shipping_cost = shipping_cost.to_f end |
Instance Attribute Details
#customer ⇒ Object
Returns the value of attribute customer.
8 9 10 |
# File 'lib/resources/checkout/destination.rb', line 8 def customer @customer end |
#shipping_cost ⇒ Object
Returns the value of attribute shipping_cost.
8 9 10 |
# File 'lib/resources/checkout/destination.rb', line 8 def shipping_cost @shipping_cost end |
#shipping_option ⇒ Object
Returns the value of attribute shipping_option.
8 9 10 |
# File 'lib/resources/checkout/destination.rb', line 8 def shipping_option @shipping_option end |
Instance Method Details
#as_hash ⇒ Object
16 17 18 19 20 21 |
# File 'lib/resources/checkout/destination.rb', line 16 def as_hash { requestedShippingOption: @shipping_option, shippingCost: @shipping_cost, shipToBillTo: false, address: @customer.as_hash } end |