Class: NetVbox::VmInfo
- Inherits:
-
Object
- Object
- NetVbox::VmInfo
- Defined in:
- lib/netvbox/vm.rb
Instance Attribute Summary collapse
-
#snapshot_name ⇒ Object
readonly
Returns the value of attribute snapshot_name.
-
#ssh_connection_info ⇒ Object
readonly
Returns the value of attribute ssh_connection_info.
-
#vm_name ⇒ Object
readonly
Returns the value of attribute vm_name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #clashes_with?(other) ⇒ Boolean
- #clashes_with_params?(hostname, username, vm_name) ⇒ Boolean
-
#initialize(ssh_connection_info, vm_name, snapshot_name) ⇒ VmInfo
constructor
A new instance of VmInfo.
- #to_s ⇒ Object
Constructor Details
#initialize(ssh_connection_info, vm_name, snapshot_name) ⇒ VmInfo
Returns a new instance of VmInfo.
24 25 26 27 28 |
# File 'lib/netvbox/vm.rb', line 24 def initialize(ssh_connection_info, vm_name, snapshot_name) @ssh_connection_info = ssh_connection_info @vm_name = vm_name @snapshot_name = snapshot_name end |
Instance Attribute Details
#snapshot_name ⇒ Object (readonly)
Returns the value of attribute snapshot_name.
22 23 24 |
# File 'lib/netvbox/vm.rb', line 22 def snapshot_name @snapshot_name end |
#ssh_connection_info ⇒ Object (readonly)
Returns the value of attribute ssh_connection_info.
22 23 24 |
# File 'lib/netvbox/vm.rb', line 22 def ssh_connection_info @ssh_connection_info end |
#vm_name ⇒ Object (readonly)
Returns the value of attribute vm_name.
22 23 24 |
# File 'lib/netvbox/vm.rb', line 22 def vm_name @vm_name end |
Instance Method Details
#==(other) ⇒ Object
40 41 42 43 44 |
# File 'lib/netvbox/vm.rb', line 40 def ==(other) self.ssh_connection_info == other.ssh_connection_info && self.vm_name == other.vm_name && self.snapshot_name == other.snapshot_name end |
#clashes_with?(other) ⇒ Boolean
30 31 32 |
# File 'lib/netvbox/vm.rb', line 30 def clashes_with?(other) clashes_with_params?(other.ssh_connection_info.hostname, other.ssh_connection_info.username, other.vm_name) end |
#clashes_with_params?(hostname, username, vm_name) ⇒ Boolean
34 35 36 37 38 |
# File 'lib/netvbox/vm.rb', line 34 def clashes_with_params?(hostname, username, vm_name) self.ssh_connection_info.hostname == hostname && self.ssh_connection_info.username == username && self.vm_name == vm_name end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/netvbox/vm.rb', line 46 def to_s "host: #{self.ssh_connection_info.hostname}, vm: #{vm_name}, snapshot: #{snapshot_name}" end |