Class: Cadooz::Immutable::VoucherInformation

Inherits:
Object
  • Object
show all
Includes:
Mixins
Defined in:
lib/cadooz/models/immutable/voucher_information.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixins

#cadooz_class, #default_value_for_nil, #instance_variables_empty?, #serialize

Constructor Details

#initialize(open_struct) ⇒ VoucherInformation

Returns a new instance of VoucherInformation.



6
7
8
9
10
11
# File 'lib/cadooz/models/immutable/voucher_information.rb', line 6

def initialize(open_struct)
  @response_state = open_struct&.response_state
  @voucher_list = Array(open_struct&.voucher_list)&.each_with_object([]) { |v, arr| arr << Cadooz::Immutable::Voucher.new(v) }

  self.freeze
end

Instance Attribute Details

#response_stateObject (readonly)

Returns the value of attribute response_state.



4
5
6
# File 'lib/cadooz/models/immutable/voucher_information.rb', line 4

def response_state
  @response_state
end

#voucher_listObject (readonly)

Returns the value of attribute voucher_list.



4
5
6
# File 'lib/cadooz/models/immutable/voucher_information.rb', line 4

def voucher_list
  @voucher_list
end