Class: WalletValidator::Eos
- Inherits:
-
Object
- Object
- WalletValidator::Eos
- Defined in:
- lib/wallet_validator/eos.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#is_testnet ⇒ Object
readonly
Returns the value of attribute is_testnet.
Instance Method Summary collapse
-
#initialize(address, is_testnet) ⇒ Eos
constructor
A new instance of Eos.
- #valid? ⇒ Boolean
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
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/wallet_validator/eos.rb', line 4 def address @address end |
#is_testnet ⇒ Object (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
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 |