Class: Ethmo::Account
- Inherits:
-
Object
- Object
- Ethmo::Account
- Defined in:
- lib/ethmo/account.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
Instance Method Summary collapse
- #balance ⇒ Object
-
#initialize(address) ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize(address) ⇒ Account
Returns a new instance of Account.
8 9 10 |
# File 'lib/ethmo/account.rb', line 8 def initialize(address) @address = address end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
6 7 8 |
# File 'lib/ethmo/account.rb', line 6 def address @address end |
Instance Method Details
#balance ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ethmo/account.rb', line 12 def balance # TODO: Add ETH value to Float Helper Client .balance_of(address, 'latest') .fetch('result', '0x0') .to_i(16) .to_f / Config::WEI end |