Class: Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialInformation
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialInformation
- Defined in:
- lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb
Instance Attribute Summary collapse
-
#amount_of_money_after_trial ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
The current value of amount_of_money_after_trial.
-
#end_date ⇒ String
The current value of end_date.
-
#is_recurring ⇒ true/false
The current value of is_recurring.
-
#trial_period ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialPeriod
The current value of trial_period.
-
#trial_period_recurring ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency
The current value of trial_period_recurring.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#amount_of_money_after_trial ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
Returns the current value of amount_of_money_after_trial.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 19 def amount_of_money_after_trial @amount_of_money_after_trial end |
#end_date ⇒ String
Returns the current value of end_date.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 19 def end_date @end_date end |
#is_recurring ⇒ true/false
Returns the current value of is_recurring.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 19 def is_recurring @is_recurring end |
#trial_period ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialPeriod
Returns the current value of trial_period.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 19 def trial_period @trial_period end |
#trial_period_recurring ⇒ Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency
Returns the current value of trial_period_recurring.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 19 def trial_period_recurring @trial_period_recurring end |
Instance Method Details
#from_hash(hash) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 42 def from_hash(hash) super if hash.has_key? 'amountOfMoneyAfterTrial' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoneyAfterTrial']] unless hash['amountOfMoneyAfterTrial'].is_a? Hash @amount_of_money_after_trial = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoneyAfterTrial']) end if hash.has_key? 'endDate' @end_date = hash['endDate'] end if hash.has_key? 'isRecurring' @is_recurring = hash['isRecurring'] end if hash.has_key? 'trialPeriod' raise TypeError, "value '%s' is not a Hash" % [hash['trialPeriod']] unless hash['trialPeriod'].is_a? Hash @trial_period = Ingenico::Connect::SDK::Domain::Hostedcheckout::TrialPeriod.new_from_hash(hash['trialPeriod']) end if hash.has_key? 'trialPeriodRecurring' raise TypeError, "value '%s' is not a Hash" % [hash['trialPeriodRecurring']] unless hash['trialPeriodRecurring'].is_a? Hash @trial_period_recurring = Ingenico::Connect::SDK::Domain::Hostedcheckout::Frequency.new_from_hash(hash['trialPeriodRecurring']) end end |
#to_h ⇒ Hash
32 33 34 35 36 37 38 39 40 |
# File 'lib/ingenico/connect/sdk/domain/hostedcheckout/trial_information.rb', line 32 def to_h hash = super hash['amountOfMoneyAfterTrial'] = @amount_of_money_after_trial.to_h unless @amount_of_money_after_trial.nil? hash['endDate'] = @end_date unless @end_date.nil? hash['isRecurring'] = @is_recurring unless @is_recurring.nil? hash['trialPeriod'] = @trial_period.to_h unless @trial_period.nil? hash['trialPeriodRecurring'] = @trial_period_recurring.to_h unless @trial_period_recurring.nil? hash end |