Class: AppChain::Address
- Inherits:
-
Object
- Object
- AppChain::Address
- Defined in:
- lib/appchain/address.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
compare address is equal.
-
#addr ⇒ String
get address with ‘0x` prefix.
-
#initialize(str) ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(str) ⇒ Address
Returns a new instance of Address.
6 7 8 |
# File 'lib/appchain/address.rb', line 6 def initialize(str) @addr = Utils.remove_hex_prefix(str) end |
Instance Method Details
#==(other) ⇒ Object
compare address is equal
20 21 22 |
# File 'lib/appchain/address.rb', line 20 def ==(other) addr.casecmp(other.addr) end |
#addr ⇒ String
get address with ‘0x` prefix
13 14 15 |
# File 'lib/appchain/address.rb', line 13 def addr Utils.add_hex_prefix(@addr) end |