Class: Worldline::Connect::SDK::V1::Domain::TrialInformation

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/trial_information.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amount_of_money_after_trialWorldline::Connect::SDK::V1::Domain::AmountOfMoney

Returns the current value of amount_of_money_after_trial.

Returns:



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_dateString

Returns the current value of end_date.

Returns:

  • (String)

    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_recurringtrue/false

Returns the current value of is_recurring.

Returns:

  • (true/false)

    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_periodWorldline::Connect::SDK::V1::Domain::TrialPeriod

Returns the current value of trial_period.

Returns:



20
21
22
# File 'lib/worldline/connect/sdk/v1/domain/trial_information.rb', line 20

def trial_period
  @trial_period
end

#trial_period_recurringWorldline::Connect::SDK::V1::Domain::Frequency

Returns the current value of trial_period_recurring.

Returns:



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_hHash

Returns:

  • (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