Class: SixSaferpay::Liability
- Inherits:
-
Object
- Object
- SixSaferpay::Liability
- Defined in:
- lib/six_saferpay/models/liability.rb
Instance Attribute Summary collapse
-
#liability_shift ⇒ Object
Returns the value of attribute liability_shift.
-
#liable_entity ⇒ Object
Returns the value of attribute liable_entity.
-
#three_ds ⇒ Object
Returns the value of attribute three_ds.
Instance Method Summary collapse
-
#initialize(liability_shift:, liable_entity:, three_ds: nil, fraud_free: nil) ⇒ Liability
constructor
A new instance of Liability.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(liability_shift:, liable_entity:, three_ds: nil, fraud_free: nil) ⇒ Liability
Returns a new instance of Liability.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/six_saferpay/models/liability.rb', line 10 def initialize(liability_shift:, liable_entity:, three_ds: nil, fraud_free: nil ) @liability_shift = liability_shift @liable_entity = liable_entity @three_ds = SixSaferpay::ThreeDs.new(**three_ds.to_h) if three_ds @fraud_free = SixSaferpay::FraudFree.new(**fraud_free.to_h) if fraud_free end |
Instance Attribute Details
#liability_shift ⇒ Object
Returns the value of attribute liability_shift.
4 5 6 |
# File 'lib/six_saferpay/models/liability.rb', line 4 def liability_shift @liability_shift end |
#liable_entity ⇒ Object
Returns the value of attribute liable_entity.
4 5 6 |
# File 'lib/six_saferpay/models/liability.rb', line 4 def liable_entity @liable_entity end |
#three_ds ⇒ Object
Returns the value of attribute three_ds.
4 5 6 |
# File 'lib/six_saferpay/models/liability.rb', line 4 def three_ds @three_ds end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
21 22 23 24 25 26 27 28 |
# File 'lib/six_saferpay/models/liability.rb', line 21 def to_hash hash = Hash.new hash.merge!(liability_shift: @liability_shift) hash.merge!(liable_entity: @liable_entity) hash.merge!(three_ds: @three_ds.to_h) if @three_ds hash.merge!(fraud_free: @fraud_free.to_h) if @fraud_free hash end |