Class: Vertpig::Wallet
- Inherits:
-
Object
- Object
- Vertpig::Wallet
- Defined in:
- lib/vertpig/wallet.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#available ⇒ Object
readonly
Returns the value of attribute available.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#pending ⇒ Object
readonly
Returns the value of attribute pending.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#requested ⇒ Object
readonly
Returns the value of attribute requested.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Wallet
constructor
A new instance of Wallet.
Constructor Details
#initialize(attrs = {}) ⇒ Wallet
Returns a new instance of Wallet.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/vertpig/wallet.rb', line 5 def initialize(attrs = {}) @id = attrs['Uuid'].to_s @address = attrs['CryptoAddress'] @currency = attrs['Currency'] @balance = attrs['Balance'] @available = attrs['Available'] @pending = attrs['Pending'] @raw = attrs @requested = attrs['Requested'] end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def address @address end |
#available ⇒ Object (readonly)
Returns the value of attribute available.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def available @available end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def balance @balance end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def id @id end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def pending @pending end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def raw @raw end |
#requested ⇒ Object (readonly)
Returns the value of attribute requested.
3 4 5 |
# File 'lib/vertpig/wallet.rb', line 3 def requested @requested end |
Class Method Details
.all ⇒ Object
16 17 18 |
# File 'lib/vertpig/wallet.rb', line 16 def self.all client.get('account/getbalances').map{|data| new(data) } end |
.balance(currency) ⇒ Object
20 21 22 23 24 |
# File 'lib/vertpig/wallet.rb', line 20 def self.balance(currency) client.get('account/getbalance', { currency: currency }) end |