Class: CfScript::InstanceStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/cf_script/object/instance_status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ InstanceStatus

Returns a new instance of InstanceStatus.



10
11
12
13
14
15
16
17
18
# File 'lib/cf_script/object/instance_status.rb', line 10

def initialize(attrs = {})
  @index   = attrs[:index]   ? attrs[:index].value   : nil
  @state   = attrs[:state]   ? attrs[:state].value   : nil
  @since   = attrs[:since]   ? attrs[:since].value   : nil
  @cpu     = attrs[:cpu]     ? attrs[:cpu].value     : nil
  @memory  = attrs[:memory]  ? attrs[:memory].value  : nil
  @disk    = attrs[:disk]    ? attrs[:disk].value    : nil
  @details = attrs[:details] ? attrs[:details].value : nil
end

Instance Attribute Details

#cpuObject (readonly)

Returns the value of attribute cpu.



5
6
7
# File 'lib/cf_script/object/instance_status.rb', line 5

def cpu
  @cpu
end

#detailsObject (readonly)

Returns the value of attribute details.



8
9
10
# File 'lib/cf_script/object/instance_status.rb', line 8

def details
  @details
end

#diskObject (readonly)

Returns the value of attribute disk.



7
8
9
# File 'lib/cf_script/object/instance_status.rb', line 7

def disk
  @disk
end

#indexObject (readonly)

Returns the value of attribute index.



2
3
4
# File 'lib/cf_script/object/instance_status.rb', line 2

def index
  @index
end

#memoryObject (readonly)

Returns the value of attribute memory.



6
7
8
# File 'lib/cf_script/object/instance_status.rb', line 6

def memory
  @memory
end

#sinceObject (readonly)

Returns the value of attribute since.



4
5
6
# File 'lib/cf_script/object/instance_status.rb', line 4

def since
  @since
end

#stateObject (readonly)

Returns the value of attribute state.



3
4
5
# File 'lib/cf_script/object/instance_status.rb', line 3

def state
  @state
end

Instance Method Details

#show(*attrs) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/cf_script/object/instance_status.rb', line 20

def show(*attrs)
  line = []

  attrs.each do |attr|
    line << "#{attr}: #{send(attr)}"
  end

  line.join(', ')
end