Class: Coinbase::Wallet::Data
- Inherits:
-
Object
- Object
- Coinbase::Wallet::Data
- Defined in:
- lib/coinbase/wallet/data.rb
Overview
The data required to recreate a Wallet.
Instance Attribute Summary collapse
-
#network_id ⇒ Object
readonly
Returns the value of attribute network_id.
-
#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:, network_id: nil) ⇒ Data
constructor
Returns a new Data object.
-
#to_hash ⇒ Hash
Converts the Data object to a Hash.
Constructor Details
#initialize(wallet_id:, seed:, network_id: nil) ⇒ Data
Returns a new Data object.
13 14 15 16 17 |
# File 'lib/coinbase/wallet/data.rb', line 13 def initialize(wallet_id:, seed:, network_id: nil) @wallet_id = wallet_id @seed = seed @network_id = network_id end |
Instance Attribute Details
#network_id ⇒ Object (readonly)
Returns the value of attribute network_id.
7 8 9 |
# File 'lib/coinbase/wallet/data.rb', line 7 def network_id @network_id end |
#seed ⇒ Object (readonly)
Returns the value of attribute seed.
7 8 9 |
# File 'lib/coinbase/wallet/data.rb', line 7 def seed @seed end |
#wallet_id ⇒ Object (readonly)
Returns the value of attribute wallet_id.
7 8 9 |
# File 'lib/coinbase/wallet/data.rb', line 7 def wallet_id @wallet_id end |
Class Method Details
Instance Method Details
#to_hash ⇒ Hash
Converts the Data object to a Hash.
21 22 23 |
# File 'lib/coinbase/wallet/data.rb', line 21 def to_hash { wallet_id: wallet_id, seed: seed, network_id: network_id } end |