Class: MundiApi::CreateSetupRequest
- Defined in:
- lib/mundi_api/models/create_setup_request.rb
Overview
Request for creating a Setup for a subscription. The setup is an order that will be created at the subscription creation.
Instance Attribute Summary collapse
-
#amount ⇒ Integer
Setup amount.
-
#description ⇒ String
Description.
-
#payment ⇒ CreatePaymentRequest
Payment data.
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(amount = nil, description = nil, payment = nil) ⇒ CreateSetupRequest
constructor
A new instance of CreateSetupRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(amount = nil, description = nil, payment = nil) ⇒ CreateSetupRequest
Returns a new instance of CreateSetupRequest.
31 32 33 34 35 36 37 |
# File 'lib/mundi_api/models/create_setup_request.rb', line 31 def initialize(amount = nil, description = nil, payment = nil) @amount = amount @description = description @payment = payment end |
Instance Attribute Details
#amount ⇒ Integer
Setup amount
10 11 12 |
# File 'lib/mundi_api/models/create_setup_request.rb', line 10 def amount @amount end |
#description ⇒ String
Description
14 15 16 |
# File 'lib/mundi_api/models/create_setup_request.rb', line 14 def description @description end |
#payment ⇒ CreatePaymentRequest
Payment data
18 19 20 |
# File 'lib/mundi_api/models/create_setup_request.rb', line 18 def payment @payment end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/mundi_api/models/create_setup_request.rb', line 40 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash['amount'] description = hash['description'] payment = CreatePaymentRequest.from_hash(hash['payment']) if hash['payment'] # Create object from extracted values. CreateSetupRequest.new(amount, description, payment) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 27 28 29 |
# File 'lib/mundi_api/models/create_setup_request.rb', line 21 def self.names if @_hash.nil? @_hash = {} @_hash['amount'] = 'amount' @_hash['description'] = 'description' @_hash['payment'] = 'payment' end @_hash end |