Class: Cadooz::Immutable::OrderPosition
- Inherits:
-
Object
- Object
- Cadooz::Immutable::OrderPosition
- Includes:
- Mixins
- Defined in:
- lib/cadooz/models/immutable/order_position.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#cadooz_product_number ⇒ Object
readonly
Returns the value of attribute cadooz_product_number.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#delivery_address ⇒ Object
readonly
Returns the value of attribute delivery_address.
-
#external_reference_number ⇒ Object
readonly
Returns the value of attribute external_reference_number.
-
#greeting_card ⇒ Object
readonly
Returns the value of attribute greeting_card.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#voucher_address ⇒ Object
readonly
Returns the value of attribute voucher_address.
-
#voucher_address_editable ⇒ Object
readonly
Returns the value of attribute voucher_address_editable.
-
#voucher_address_preset ⇒ Object
readonly
Returns the value of attribute voucher_address_preset.
Instance Method Summary collapse
-
#initialize(open_struct) ⇒ OrderPosition
constructor
A new instance of OrderPosition.
Methods included from Mixins
#cadooz_class, #default_value_for_nil, #instance_variables_empty?, #serialize
Constructor Details
#initialize(open_struct) ⇒ OrderPosition
Returns a new instance of OrderPosition.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 9 def initialize(open_struct) @amount = open_struct&.amount @attributes = open_struct&.attributes&.inject({}) { |hash, element| hash.merge(element.key.to_sym => element.value) } @cadooz_product_number = open_struct&.cadooz_product_number @currency = open_struct&.currency @delivery_address = open_struct&.delivery_address @external_reference_number = open_struct&.external_reference_number @greeting_card = open_struct&.greeting_card @value = open_struct&.value @voucher_address = open_struct&.voucher_address @voucher_address_editable = open_struct&.voucher_address_editable @voucher_address_preset = open_struct&.voucher_address_preset self.freeze end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def attributes @attributes end |
#cadooz_product_number ⇒ Object (readonly)
Returns the value of attribute cadooz_product_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def cadooz_product_number @cadooz_product_number end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def currency @currency end |
#delivery_address ⇒ Object (readonly)
Returns the value of attribute delivery_address.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def delivery_address @delivery_address end |
#external_reference_number ⇒ Object (readonly)
Returns the value of attribute external_reference_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def external_reference_number @external_reference_number end |
#greeting_card ⇒ Object (readonly)
Returns the value of attribute greeting_card.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def greeting_card @greeting_card end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def value @value end |
#voucher_address ⇒ Object (readonly)
Returns the value of attribute voucher_address.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def voucher_address @voucher_address end |
#voucher_address_editable ⇒ Object (readonly)
Returns the value of attribute voucher_address_editable.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def voucher_address_editable @voucher_address_editable end |
#voucher_address_preset ⇒ Object (readonly)
Returns the value of attribute voucher_address_preset.
4 5 6 |
# File 'lib/cadooz/models/immutable/order_position.rb', line 4 def voucher_address_preset @voucher_address_preset end |