Class: AdvancedBilling::CreatePayment
- Defined in:
- lib/advanced_billing/models/create_payment.rb
Overview
CreatePayment Model.
Instance Attribute Summary collapse
-
#amount ⇒ String
TODO: Write general description for this method.
-
#memo ⇒ String
TODO: Write general description for this method.
-
#payment_details ⇒ String
TODO: Write general description for this method.
-
#payment_method ⇒ String
TODO: Write general description for this method.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(amount = nil, memo = nil, payment_details = nil, payment_method = nil) ⇒ CreatePayment
constructor
A new instance of CreatePayment.
Methods inherited from BaseModel
Constructor Details
#initialize(amount = nil, memo = nil, payment_details = nil, payment_method = nil) ⇒ CreatePayment
Returns a new instance of CreatePayment.
48 49 50 51 52 53 54 |
# File 'lib/advanced_billing/models/create_payment.rb', line 48 def initialize(amount = nil, memo = nil, payment_details = nil, payment_method = nil) @amount = amount @memo = memo @payment_details = payment_details @payment_method = payment_method end |
Instance Attribute Details
#amount ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/create_payment.rb', line 14 def amount @amount end |
#memo ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/create_payment.rb', line 18 def memo @memo end |
#payment_details ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/create_payment.rb', line 22 def payment_details @payment_details end |
#payment_method ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/create_payment.rb', line 26 def payment_method @payment_method end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/advanced_billing/models/create_payment.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash.key?('amount') ? hash['amount'] : nil memo = hash.key?('memo') ? hash['memo'] : nil payment_details = hash.key?('payment_details') ? hash['payment_details'] : nil payment_method = hash.key?('payment_method') ? hash['payment_method'] : nil # Create object from extracted values. CreatePayment.new(amount, memo, payment_details, payment_method) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/advanced_billing/models/create_payment.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['memo'] = 'memo' @_hash['payment_details'] = 'payment_details' @_hash['payment_method'] = 'payment_method' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/advanced_billing/models/create_payment.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 |
# File 'lib/advanced_billing/models/create_payment.rb', line 39 def self.optionals [] end |