class Nem::NodePool
Attributes
failed[R]
nodes[R]
Public Class Methods
from_hash(definitions)
click to toggle source
# File lib/nem/node_pool.rb, line 9 def self.from_hash(definitions) new(definitions.map { |d| Nem::Node.new(d) }) end
new(nodes)
click to toggle source
# File lib/nem/node_pool.rb, line 13 def initialize(nodes) @nodes = nodes @failed = [] end
Public Instance Methods
<<(definitioin)
click to toggle source
# File lib/nem/node_pool.rb, line 27 def <<(definitioin) @nodes << Nem::Node.new(definitioin) end
current()
click to toggle source
# File lib/nem/node_pool.rb, line 18 def current @nodes.first end
next!()
click to toggle source
# File lib/nem/node_pool.rb, line 22 def next! @failed << @nodes.shift raise 'Exhausted node pool' if length.zero? end