Class: Cadooz::Immutable::Voucher
- Inherits:
-
Object
- Object
- Cadooz::Immutable::Voucher
- Includes:
- Mixins
- Defined in:
- lib/cadooz/models/immutable/voucher.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#ecard_link ⇒ Object
readonly
Returns the value of attribute ecard_link.
-
#evoucher_link ⇒ Object
readonly
Returns the value of attribute evoucher_link.
-
#pin ⇒ Object
readonly
Returns the value of attribute pin.
-
#product_name ⇒ Object
readonly
Returns the value of attribute product_name.
-
#product_number ⇒ Object
readonly
Returns the value of attribute product_number.
-
#product_variation_number ⇒ Object
readonly
Returns the value of attribute product_variation_number.
-
#serial_number ⇒ Object
readonly
Returns the value of attribute serial_number.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(open_struct) ⇒ Voucher
constructor
A new instance of Voucher.
Methods included from Mixins
#cadooz_class, #default_value_for_nil, #instance_variables_empty?, #serialize
Constructor Details
#initialize(open_struct) ⇒ Voucher
Returns a new instance of Voucher.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 8 def initialize(open_struct) @address = Cadooz::Immutable::Address.new(open_struct&.address) @code = open_struct&.code @currency = open_struct&.currency @ecard_link = open_struct&.ecard_link @evoucher_link = open_struct&.evoucher_link @pin = open_struct&.pin @product_name = open_struct&.product_name @product_number = open_struct&.product_number @product_variation_number = open_struct&.product_variation_number @serial_number = open_struct&.serial_number @value = open_struct&.value.to_f self.freeze end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def address @address end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def code @code end |
#ecard_link ⇒ Object (readonly)
Returns the value of attribute ecard_link.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def ecard_link @ecard_link end |
#evoucher_link ⇒ Object (readonly)
Returns the value of attribute evoucher_link.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def evoucher_link @evoucher_link end |
#pin ⇒ Object (readonly)
Returns the value of attribute pin.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def pin @pin end |
#product_name ⇒ Object (readonly)
Returns the value of attribute product_name.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def product_name @product_name end |
#product_number ⇒ Object (readonly)
Returns the value of attribute product_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def product_number @product_number end |
#product_variation_number ⇒ Object (readonly)
Returns the value of attribute product_variation_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def product_variation_number @product_variation_number end |
#serial_number ⇒ Object (readonly)
Returns the value of attribute serial_number.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def serial_number @serial_number end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/cadooz/models/immutable/voucher.rb', line 4 def value @value end |