Class: K2Transaction
- Inherits:
-
Object
- Object
- K2Transaction
- Defined in:
- lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#callback_url ⇒ Object
readonly
Returns the value of attribute callback_url.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#links_self ⇒ Object
readonly
Returns the value of attribute links_self.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(payload) ⇒ K2Transaction
constructor
A new instance of K2Transaction.
Constructor Details
#initialize(payload) ⇒ K2Transaction
Returns a new instance of K2Transaction.
8 9 10 11 12 13 14 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 8 def initialize(payload) @id = payload.dig('data', 'id') @type = payload.dig('data', 'type') @metadata = payload.dig('data', 'attributes', 'metadata') @links_self = payload.dig('data', 'attributes', '_links', 'self') @callback_url = payload.dig('data', 'attributes', '_links', 'callback_url') end |
Instance Attribute Details
#callback_url ⇒ Object (readonly)
Returns the value of attribute callback_url.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2 def callback_url @callback_url end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2 def id @id end |
#links_self ⇒ Object (readonly)
Returns the value of attribute links_self.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2 def links_self @links_self end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2 def @metadata end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
2 3 4 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2 def type @type end |