Class: Worldline::Connect::SDK::V1::Domain::TrialInformation
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Connect::SDK::V1::Domain::TrialInformation
- Defined in:
- lib/worldline/connect/sdk/v1/domain/trial_information.rb
Instance Attribute Summary collapse
-
#amount_of_money_after_trial ⇒ Worldline::Connect::SDK::V1::Domain::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 ⇒ Worldline::Connect::SDK::V1::Domain::TrialPeriod
The current value of trial_period.
-
#trial_period_recurring ⇒ Worldline::Connect::SDK::V1::Domain::Frequency
The current value of trial_period_recurring.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#amount_of_money_after_trial ⇒ Worldline::Connect::SDK::V1::Domain::AmountOfMoney
Returns the current value of amount_of_money_after_trial.
20 21 22 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 20 def amount_of_money_after_trial @amount_of_money_after_trial end |
#end_date ⇒ String
Returns the current value of end_date.
20 21 22 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 20 def end_date @end_date end |
#is_recurring ⇒ true/false
Returns the current value of is_recurring.
20 21 22 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 20 def is_recurring @is_recurring end |
#trial_period ⇒ Worldline::Connect::SDK::V1::Domain::TrialPeriod
Returns the current value of trial_period.
20 21 22 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 20 def trial_period @trial_period end |
#trial_period_recurring ⇒ Worldline::Connect::SDK::V1::Domain::Frequency
Returns the current value of trial_period_recurring.
20 21 22 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 20 def trial_period_recurring @trial_period_recurring end |
Instance Method Details
#from_hash(hash) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 43 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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::Frequency.new_from_hash(hash['trialPeriodRecurring']) end end |
#to_h ⇒ Hash
33 34 35 36 37 38 39 40 41 |
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 33 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 |