Class: OnlinePayments::SDK::Domain::AdditionalOrderInput

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/additional_order_input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#airline_dataOnlinePayments::SDK::Domain::AirlineData

Returns the current value of airline_data.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/additional_order_input.rb', line 17

def airline_data
  @airline_data
end

#loan_recipientOnlinePayments::SDK::Domain::LoanRecipient

Returns the current value of loan_recipient.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/additional_order_input.rb', line 17

def loan_recipient
  @loan_recipient
end

#lodging_dataOnlinePayments::SDK::Domain::LodgingData

Returns the current value of lodging_data.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/additional_order_input.rb', line 17

def lodging_data
  @lodging_data
end

#type_informationOnlinePayments::SDK::Domain::OrderTypeInformation

Returns the current value of type_information.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/additional_order_input.rb', line 17

def type_information
  @type_information
end

Instance Method Details

#from_hash(hash) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/onlinepayments/sdk/domain/additional_order_input.rb', line 33

def from_hash(hash)
  super
  if hash.key? 'airlineData'
    raise TypeError, "value '%s' is not a Hash" % [hash['airlineData']] unless hash['airlineData'].is_a? Hash
    @airline_data = OnlinePayments::SDK::Domain::AirlineData.new_from_hash(hash['airlineData'])
  end
  if hash.key? 'loanRecipient'
    raise TypeError, "value '%s' is not a Hash" % [hash['loanRecipient']] unless hash['loanRecipient'].is_a? Hash
    @loan_recipient = OnlinePayments::SDK::Domain::LoanRecipient.new_from_hash(hash['loanRecipient'])
  end
  if hash.key? 'lodgingData'
    raise TypeError, "value '%s' is not a Hash" % [hash['lodgingData']] unless hash['lodgingData'].is_a? Hash
    @lodging_data = OnlinePayments::SDK::Domain::LodgingData.new_from_hash(hash['lodgingData'])
  end
  if hash.key? 'typeInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['typeInformation']] unless hash['typeInformation'].is_a? Hash
    @type_information = OnlinePayments::SDK::Domain::OrderTypeInformation.new_from_hash(hash['typeInformation'])
  end
end

#to_hHash

Returns:

  • (Hash)


24
25
26
27
28
29
30
31
# File 'lib/onlinepayments/sdk/domain/additional_order_input.rb', line 24

def to_h
  hash = super
  hash['airlineData'] = @airline_data.to_h if @airline_data
  hash['loanRecipient'] = @loan_recipient.to_h if @loan_recipient
  hash['lodgingData'] = @lodging_data.to_h if @lodging_data
  hash['typeInformation'] = @type_information.to_h if @type_information
  hash
end