Class: Banano::Protocol
- Inherits:
-
Object
- Object
- Banano::Protocol
- Defined in:
- lib/banano.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#account(address) ⇒ Banano::Account
Returns a new instance of Account.
-
#block(block) ⇒ Banano::Block
Returns a new instance of Block.
-
#initialize(uri: Client::LOCAL_ENDPOINT, timeout: Client::DEFAULT_TIMEOUT) ⇒ Protocol
constructor
A new instance of Protocol.
-
#key(key = nil) ⇒ Banano::Key
Returns a new instance of Key.
-
#wallet(wallet = nil) ⇒ Banano::Wallet
Returns a new instance of Wallet.
Constructor Details
#initialize(uri: Client::LOCAL_ENDPOINT, timeout: Client::DEFAULT_TIMEOUT) ⇒ Protocol
Returns a new instance of Protocol.
9 10 11 |
# File 'lib/banano.rb', line 9 def initialize(uri: Client::LOCAL_ENDPOINT, timeout: Client::DEFAULT_TIMEOUT) @node = Node.new(uri: uri, timeout: timeout) end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
7 8 9 |
# File 'lib/banano.rb', line 7 def node @node end |
Instance Method Details
#account(address) ⇒ Banano::Account
20 21 22 |
# File 'lib/banano.rb', line 20 def account(address) Banano::Account.new(node: @node, address: address) end |
#block(block) ⇒ Banano::Block
31 32 33 |
# File 'lib/banano.rb', line 31 def block(block) Banano::Block.new(node: @node, block: block) end |
#key(key = nil) ⇒ Banano::Key
42 43 44 |
# File 'lib/banano.rb', line 42 def key(key = nil) Banano::Key.new(node: @node, key: key) end |