Class: Sdp::Wallet
- Inherits:
-
Struct
- Object
- Struct
- Sdp::Wallet
- Defined in:
- lib/sdp/resources/wallets.rb
Overview
Custody wallet. #id is SDP’s walletId — the identifier the payments API expects — not the database row id. balances is only populated when the list was fetched with include_balances: true.
Instance Attribute Summary collapse
-
#balances ⇒ Object
Returns the value of attribute balances.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
-
#purpose ⇒ Object
Returns the value of attribute purpose.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Attribute Details
#balances ⇒ Object
Returns the value of attribute balances
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def balances @balances end |
#created_at ⇒ Object
Returns the value of attribute created_at
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def id @id end |
#label ⇒ Object
Returns the value of attribute label
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def label @label end |
#provider ⇒ Object
Returns the value of attribute provider
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def provider @provider end |
#public_key ⇒ Object
Returns the value of attribute public_key
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def public_key @public_key end |
#purpose ⇒ Object
Returns the value of attribute purpose
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def purpose @purpose end |
#status ⇒ Object
Returns the value of attribute status
27 28 29 |
# File 'lib/sdp/resources/wallets.rb', line 27 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sdp/resources/wallets.rb', line 29 def self.from_hash(hash) hash ||= {} new( id: hash[:wallet_id] || hash[:id], public_key: hash[:public_key], label: hash[:label], status: hash[:status], provider: hash[:provider], purpose: hash[:purpose], created_at: hash[:created_at], balances: hash[:balances]&.map { |balance| Balance.from_hash(balance) } ) end |