Class: SixSaferpay::RiskFactors
- Inherits:
-
Object
- Object
- SixSaferpay::RiskFactors
- Defined in:
- lib/six_saferpay/models/risk_factors.rb
Instance Attribute Summary collapse
-
#delivery_type ⇒ Object
Returns the value of attribute delivery_type.
-
#payer_profile ⇒ Object
Returns the value of attribute payer_profile.
Instance Method Summary collapse
-
#initialize(delivery_type: nil, payer_profile: nil, is_b2b: nil) ⇒ RiskFactors
constructor
A new instance of RiskFactors.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(delivery_type: nil, payer_profile: nil, is_b2b: nil) ⇒ RiskFactors
Returns a new instance of RiskFactors.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/six_saferpay/models/risk_factors.rb', line 10 def initialize( delivery_type: nil, payer_profile: nil, is_b2b: nil ) @delivery_type = delivery_type if payer_profile @payer_profile = SixSaferpay::PayerProfile.new(**payer_profile.to_h) end @is_b2b = is_b2b end |
Instance Attribute Details
#delivery_type ⇒ Object
Returns the value of attribute delivery_type.
4 5 6 |
# File 'lib/six_saferpay/models/risk_factors.rb', line 4 def delivery_type @delivery_type end |
#payer_profile ⇒ Object
Returns the value of attribute payer_profile.
4 5 6 |
# File 'lib/six_saferpay/models/risk_factors.rb', line 4 def payer_profile @payer_profile end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/six_saferpay/models/risk_factors.rb', line 23 def to_hash hash = Hash.new if @delivery_type hash.merge!(delivery_type: @delivery_type) end if @payer_profile hash.merge!(payer_profile: @payer_profile.to_h) end if !@is_b2b.nil? hash.merge!(is_b2b: @is_b2b) end hash end |