Class: Sdp::Transfer
- Inherits:
-
Struct
- Object
- Struct
- Sdp::Transfer
- Defined in:
- lib/sdp/resources/payments.rb
Overview
A transfer as SDP reports it. SDP omits optional fields entirely —source/destination/amount/memo can be ABSENT from the JSON, not null —so every member is nil when SDP didn’t send it.
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#error ⇒ Object
Returns the value of attribute error.
-
#id ⇒ Object
Returns the value of attribute id.
-
#memo ⇒ Object
Returns the value of attribute memo.
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#source ⇒ Object
Returns the value of attribute source.
-
#status ⇒ Object
Returns the value of attribute status.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def amount @amount end |
#created_at ⇒ Object
Returns the value of attribute created_at
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def created_at @created_at end |
#destination ⇒ Object
Returns the value of attribute destination
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def destination @destination end |
#direction ⇒ Object
Returns the value of attribute direction
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def direction @direction end |
#error ⇒ Object
Returns the value of attribute error
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def error @error end |
#id ⇒ Object
Returns the value of attribute id
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def id @id end |
#memo ⇒ Object
Returns the value of attribute memo
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def memo @memo end |
#signature ⇒ Object
Returns the value of attribute signature
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def signature @signature end |
#source ⇒ Object
Returns the value of attribute source
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def source @source end |
#status ⇒ Object
Returns the value of attribute status
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def status @status end |
#token ⇒ Object
Returns the value of attribute token
9 10 11 |
# File 'lib/sdp/resources/payments.rb', line 9 def token @token end |
Class Method Details
.from_hash(hash) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sdp/resources/payments.rb', line 12 def self.from_hash(hash) hash ||= {} new( id: hash[:id], direction: hash[:direction], status: hash[:status], signature: hash[:signature], token: hash[:token], amount: hash[:amount], source: hash[:source], destination: hash[:destination], memo: hash[:memo], error: hash[:error], created_at: hash[:created_at] ) end |