Class: MundiApi::CreateCheckoutCardInstallmentOptionRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mundi_api/models/create_checkout_card_installment_option_request.rb

Overview

Options for card installment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(number = nil, total = nil) ⇒ CreateCheckoutCardInstallmentOptionRequest

Returns a new instance of CreateCheckoutCardInstallmentOptionRequest.



25
26
27
28
29
# File 'lib/mundi_api/models/create_checkout_card_installment_option_request.rb', line 25

def initialize(number = nil,
               total = nil)
  @number = number
  @total = total
end

Instance Attribute Details

#numberInteger

Installment quantity

Returns:

  • (Integer)


9
10
11
# File 'lib/mundi_api/models/create_checkout_card_installment_option_request.rb', line 9

def number
  @number
end

#totalInteger

Total amount

Returns:

  • (Integer)


13
14
15
# File 'lib/mundi_api/models/create_checkout_card_installment_option_request.rb', line 13

def total
  @total
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/mundi_api/models/create_checkout_card_installment_option_request.rb', line 32

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  number = hash['number']
  total = hash['total']

  # Create object from extracted values.
  CreateCheckoutCardInstallmentOptionRequest.new(number,
                                                 total)
end

.namesObject

A mapping from model property names to API property names.



16
17
18
19
20
21
22
23
# File 'lib/mundi_api/models/create_checkout_card_installment_option_request.rb', line 16

def self.names
  if @_hash.nil?
    @_hash = {}
    @_hash['number'] = 'number'
    @_hash['total'] = 'total'
  end
  @_hash
end