Class: WalletValidator::Eos

Inherits:
Object
  • Object
show all
Defined in:
lib/wallet_validator/eos.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, is_testnet) ⇒ Eos

Returns a new instance of Eos.



6
7
8
9
# File 'lib/wallet_validator/eos.rb', line 6

def initialize(address, is_testnet)
  @address = address
  @is_testnet = is_testnet
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



4
5
6
# File 'lib/wallet_validator/eos.rb', line 4

def address
  @address
end

#is_testnetObject (readonly)

Returns the value of attribute is_testnet.



4
5
6
# File 'lib/wallet_validator/eos.rb', line 4

def is_testnet
  @is_testnet
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/wallet_validator/eos.rb', line 11

def valid?
  return !!address.match(/(^[a-z1-5.]{0,11}[a-z1-5]$)|(^[a-z1-5.]{12}[a-j1-5]$)/)
end