Class: Nanook::WorkPeer
- Inherits:
-
Object
- Object
- Nanook::WorkPeer
- Includes:
- Util
- Defined in:
- lib/nanook/work_peer.rb
Overview
The Nanook::WorkPeer
class lets you manage your node's work peers.
Constant Summary
Constants included from Util
Instance Method Summary collapse
- #add(address:, port:) ⇒ Object
- #clear ⇒ Object
-
#initialize(rpc) ⇒ WorkPeer
constructor
A new instance of WorkPeer.
- #list ⇒ Object
- #to_s ⇒ String (also: #inspect)
Constructor Details
#initialize(rpc) ⇒ WorkPeer
Returns a new instance of WorkPeer.
10 11 12 |
# File 'lib/nanook/work_peer.rb', line 10 def initialize(rpc) @rpc = rpc end |
Instance Method Details
#add(address:, port:) ⇒ Object
14 15 16 |
# File 'lib/nanook/work_peer.rb', line 14 def add(address:, port:) rpc(:work_peer_add, address: address, port: port).key?(:success) end |
#clear ⇒ Object
18 19 20 |
# File 'lib/nanook/work_peer.rb', line 18 def clear rpc(:work_peers_clear).key?(:success) end |
#list ⇒ Object
28 29 30 |
# File 'lib/nanook/work_peer.rb', line 28 def list rpc(:work_peers, _access: :work_peers, _coerce: Array) end |
#to_s ⇒ String Also known as: inspect
23 24 25 |
# File 'lib/nanook/work_peer.rb', line 23 def to_s self.class.name end |