Class: Asdawqw::SplitPayment
- Defined in:
- lib/asdawqw/models/split_payment.rb
Overview
SplitPayment Model.
Instance Attribute Summary collapse
-
#deposit_type ⇒ DepositTypeEnum
First payment deposit type.
-
#second_payment_days ⇒ Integer
Number of days before check-in when second payment is required.
-
#value ⇒ Float
First payment value.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(deposit_type = nil, value = nil, second_payment_days = nil) ⇒ SplitPayment
constructor
A new instance of SplitPayment.
Methods inherited from BaseModel
Constructor Details
#initialize(deposit_type = nil, value = nil, second_payment_days = nil) ⇒ SplitPayment
Returns a new instance of SplitPayment.
30 31 32 33 34 35 36 |
# File 'lib/asdawqw/models/split_payment.rb', line 30 def initialize(deposit_type = nil, value = nil, second_payment_days = nil) @deposit_type = deposit_type @value = value @second_payment_days = second_payment_days end |
Instance Attribute Details
#deposit_type ⇒ DepositTypeEnum
First payment deposit type. FLAT,NON
11 12 13 |
# File 'lib/asdawqw/models/split_payment.rb', line 11 def deposit_type @deposit_type end |
#second_payment_days ⇒ Integer
Number of days before check-in when second payment is required.
19 20 21 |
# File 'lib/asdawqw/models/split_payment.rb', line 19 def second_payment_days @second_payment_days end |
#value ⇒ Float
First payment value
15 16 17 |
# File 'lib/asdawqw/models/split_payment.rb', line 15 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/asdawqw/models/split_payment.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. deposit_type = hash['depositType'] value = hash['value'] second_payment_days = hash['secondPaymentDays'] # Create object from extracted values. SplitPayment.new(deposit_type, value, second_payment_days) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 28 |
# File 'lib/asdawqw/models/split_payment.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['deposit_type'] = 'depositType' @_hash['value'] = 'value' @_hash['second_payment_days'] = 'secondPaymentDays' @_hash end |