Class: Falcore::Node::Slave
Instance Attribute Summary collapse
- #master ⇒ Node::Master readonly
Instance Method Summary collapse
-
#id ⇒ String
Namespace the slave under it’s master.
-
#initialize(master, data = {}) ⇒ Slave
constructor
A new instance of Slave.
Methods inherited from Base
#disk_space, #display_name, #executors, #free_memory, #free_swap, #idle?, #inspect, #offline?, #response_time, #temporarily_offline?, #temporary_space, #to_s, #total_memory, #total_swap
Constructor Details
#initialize(master, data = {}) ⇒ Slave
Returns a new instance of Slave.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/falcore/nodes/slave.rb', line 28 def initialize(master, data = {}) super(data) unless master.is_a?(Node::Master) raise ArgumentError, "#{master.class} is not an Falcore::Node::Master!" end @master = master @master.add_slave(self) end |
Instance Attribute Details
#master ⇒ Node::Master (readonly)
22 23 24 |
# File 'lib/falcore/nodes/slave.rb', line 22 def master @master end |
Instance Method Details
#id ⇒ String
Namespace the slave under it’s master.
44 45 46 |
# File 'lib/falcore/nodes/slave.rb', line 44 def id "#{@master.id}.#{display_name.gsub(/\./, '-')}" end |