Class: Vagrant::Hivemind::Host
- Inherits:
-
Object
- Object
- Vagrant::Hivemind::Host
- Defined in:
- lib/vagrant/hivemind/host.rb
Instance Attribute Summary collapse
-
#box_size ⇒ Object
Returns the value of attribute box_size.
-
#box_type ⇒ Object
Returns the value of attribute box_type.
-
#forwarded_ports ⇒ Object
Returns the value of attribute forwarded_ports.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#is_control ⇒ Object
Returns the value of attribute is_control.
-
#is_data_detached ⇒ Object
Returns the value of attribute is_data_detached.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hostname, ip_address, options = {}) ⇒ Host
constructor
A new instance of Host.
Constructor Details
#initialize(hostname, ip_address, options = {}) ⇒ Host
Returns a new instance of Host.
9 10 11 12 13 14 15 16 17 |
# File 'lib/vagrant/hivemind/host.rb', line 9 def initialize(hostname, ip_address, = {}) @hostname = hostname @ip_address = ip_address @is_control = [:is_control] || false @box_size = [:box_size] || :small.to_s @box_type = [:box_type] || :server.to_s @forwarded_ports = [] @is_data_detached = [:is_data_detached] || false end |
Instance Attribute Details
#box_size ⇒ Object
Returns the value of attribute box_size.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def box_size @box_size end |
#box_type ⇒ Object
Returns the value of attribute box_type.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def box_type @box_type end |
#forwarded_ports ⇒ Object
Returns the value of attribute forwarded_ports.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def forwarded_ports @forwarded_ports end |
#hostname ⇒ Object
Returns the value of attribute hostname.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def hostname @hostname end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def ip_address @ip_address end |
#is_control ⇒ Object
Returns the value of attribute is_control.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def is_control @is_control end |
#is_data_detached ⇒ Object
Returns the value of attribute is_data_detached.
6 7 8 |
# File 'lib/vagrant/hivemind/host.rb', line 6 def is_data_detached @is_data_detached end |
Class Method Details
.control ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vagrant/hivemind/host.rb', line 19 def self.control unless @control @control = self.new( Constants::CONTROL_HOSTNAME, Util::Network.starting_ip_address, { is_control: true, box_size: :small.to_s, box_type: :server.to_s }) end @control end |