Class: WalletValidator::Xem
- Inherits:
-
Object
- Object
- WalletValidator::Xem
- Defined in:
- lib/wallet_validator/xem.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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(address, is_testnet) ⇒ Xem
constructor
A new instance of Xem.
- #valid? ⇒ Boolean
Constructor Details
#initialize(address, is_testnet) ⇒ Xem
6 7 8 9 |
# File 'lib/wallet_validator/xem.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/xem.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/xem.rb', line 4 def is_testnet @is_testnet end |
Class Method Details
.validate_sign_msg(msg) ⇒ Object
15 16 17 |
# File 'lib/wallet_validator/xem.rb', line 15 def self.validate_sign_msg(msg) !!msg.match(/^[\da-zA-Z]{,32}$/) end |
Instance Method Details
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/wallet_validator/xem.rb', line 11 def valid? Crypto::Base32.valid?(address, is_testnet) end |