Class: Coinbase::Wallet::Data
- Inherits:
-
Object
- Object
- Coinbase::Wallet::Data
- Defined in:
- lib/coinbase/wallet.rb
Overview
The data required to recreate a Wallet.
Instance Attribute Summary collapse
-
#seed ⇒ Object
readonly
Returns the value of attribute seed.
-
#wallet_id ⇒ Object
readonly
Returns the value of attribute wallet_id.
Class Method Summary collapse
-
.from_hash(data) ⇒ Data
Creates a Data object from the given Hash.
Instance Method Summary collapse
-
#initialize(wallet_id:, seed:) ⇒ Data
constructor
Returns a new Data object.
-
#to_hash ⇒ Hash
Converts the Data object to a Hash.
Constructor Details
#initialize(wallet_id:, seed:) ⇒ Data
Returns a new Data object.
164 165 166 167 |
# File 'lib/coinbase/wallet.rb', line 164 def initialize(wallet_id:, seed:) @wallet_id = wallet_id @seed = seed end |
Instance Attribute Details
#seed ⇒ Object (readonly)
Returns the value of attribute seed.
159 160 161 |
# File 'lib/coinbase/wallet.rb', line 159 def seed @seed end |
#wallet_id ⇒ Object (readonly)
Returns the value of attribute wallet_id.
159 160 161 |
# File 'lib/coinbase/wallet.rb', line 159 def wallet_id @wallet_id end |
Class Method Details
.from_hash(data) ⇒ Data
Creates a Data object from the given Hash.
178 179 180 |
# File 'lib/coinbase/wallet.rb', line 178 def self.from_hash(data) Data.new(wallet_id: data['wallet_id'], seed: data['seed']) end |
Instance Method Details
#to_hash ⇒ Hash
Converts the Data object to a Hash.
171 172 173 |
# File 'lib/coinbase/wallet.rb', line 171 def to_hash { wallet_id: wallet_id, seed: seed } end |