Class: PaymentsApi::PaymentStatus
- Defined in:
- lib/payments_api/models/payment_status.rb
Overview
Payment Information Data
Instance Attribute Summary collapse
-
#approved ⇒ Boolean
Set to true once the payment has been approved.
-
#sent ⇒ Boolean
Set to true once the payment has been sent.
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(approved = nil, sent = nil) ⇒ PaymentStatus
constructor
A new instance of PaymentStatus.
Methods inherited from BaseModel
Constructor Details
#initialize(approved = nil, sent = nil) ⇒ PaymentStatus
Returns a new instance of PaymentStatus.
25 26 27 28 29 |
# File 'lib/payments_api/models/payment_status.rb', line 25 def initialize(approved = nil, sent = nil) @approved = approved @sent = sent end |
Instance Attribute Details
#approved ⇒ Boolean
Set to true once the payment has been approved
11 12 13 |
# File 'lib/payments_api/models/payment_status.rb', line 11 def approved @approved end |
#sent ⇒ Boolean
Set to true once the payment has been sent
15 16 17 |
# File 'lib/payments_api/models/payment_status.rb', line 15 def sent @sent 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/payments_api/models/payment_status.rb', line 32 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. approved = hash['approved'] sent = hash['sent'] # Create object from extracted values. PaymentStatus.new(approved, sent) end |
.names ⇒ Object
A mapping from model property names to API property names.
18 19 20 21 22 23 |
# File 'lib/payments_api/models/payment_status.rb', line 18 def self.names @_hash = {} if @_hash.nil? @_hash['approved'] = 'approved' @_hash['sent'] = 'sent' @_hash end |