Class: UnitHosting::Group
- Inherits:
-
Object
- Object
- UnitHosting::Group
- Includes:
- Api
- Defined in:
- lib/unit-hosting/group.rb
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
Returns the value of attribute instance_id.
-
#key ⇒ Object
(also: #apikey)
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
-
#remote ⇒ Object
Returns the value of attribute remote.
-
#vms ⇒ Object
Returns the value of attribute vms.
Instance Method Summary collapse
-
#initialize(instance_id = nil) ⇒ Group
constructor
A new instance of Group.
- #tablize ⇒ Object
- #update ⇒ Object
Methods included from Api
Constructor Details
#initialize(instance_id = nil) ⇒ Group
Returns a new instance of Group.
38 39 40 |
# File 'lib/unit-hosting/group.rb', line 38 def initialize(instance_id = nil) @instance_id = instance_id end |
Instance Attribute Details
#instance_id ⇒ Object
Returns the value of attribute instance_id.
35 36 37 |
# File 'lib/unit-hosting/group.rb', line 35 def instance_id @instance_id end |
#key ⇒ Object Also known as: apikey
Returns the value of attribute key.
35 36 37 |
# File 'lib/unit-hosting/group.rb', line 35 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
35 36 37 |
# File 'lib/unit-hosting/group.rb', line 35 def name @name end |
#remote ⇒ Object
Returns the value of attribute remote.
35 36 37 |
# File 'lib/unit-hosting/group.rb', line 35 def remote @remote end |
#vms ⇒ Object
Returns the value of attribute vms.
35 36 37 |
# File 'lib/unit-hosting/group.rb', line 35 def vms @vms end |
Instance Method Details
#tablize ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/unit-hosting/group.rb', line 48 def tablize table = Mutter::Table.new(:delimiter => '|') do column :style => :green column;column end return "#{instance_id} has no vms" unless @vms @vms.each { |vm| table << [vm["instance_id"],vm["status"],vm["display_name"]] } table.to_s if @vms.length > 0 end |