Class: AppChain::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/appchain/address.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Address

Returns a new instance of Address.

Parameters:

  • str (String)


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

Parameters:



20
21
22
# File 'lib/appchain/address.rb', line 20

def ==(other)
  addr.casecmp(other.addr)
end

#addrString

get address with ‘0x` prefix

Returns:

  • (String)

    address hex string with ‘0x` prefix



13
14
15
# File 'lib/appchain/address.rb', line 13

def addr
  Utils.add_hex_prefix(@addr)
end