Class: VmInfo
- Inherits:
-
Object
- Object
- VmInfo
- Defined in:
- lib/archipel/api/vm/vm_info.rb
Defined Under Namespace
Classes: State
Instance Attribute Summary collapse
-
#autostart ⇒ Object
readonly
Returns the value of attribute autostart.
-
#cpu_number ⇒ Object
readonly
Returns the value of attribute cpu_number.
-
#cpu_usage ⇒ Object
readonly
Returns the value of attribute cpu_usage.
-
#memory ⇒ Object
readonly
Returns the value of attribute memory.
-
#memory_max ⇒ Object
readonly
Returns the value of attribute memory_max.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(state, autostart, memory_kib, memory_max_kib, cpu_usage, cpu_number) ⇒ VmInfo
constructor
A new instance of VmInfo.
Constructor Details
#initialize(state, autostart, memory_kib, memory_max_kib, cpu_usage, cpu_number) ⇒ VmInfo
Returns a new instance of VmInfo.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/archipel/api/vm/vm_info.rb', line 45 def initialize state, autostart, memory_kib, memory_max_kib, cpu_usage, cpu_number @state = State.from_int state.to_i @autostart = autostart.to_i == 0 ? false : true @memory = memory_kib.to_i * 1024 @memory_max = memory_max_kib.to_i * 1024 @cpu_usage = cpu_usage.to_i @cpu_number = cpu_number.to_i end |
Instance Attribute Details
#autostart ⇒ Object (readonly)
Returns the value of attribute autostart.
41 42 43 |
# File 'lib/archipel/api/vm/vm_info.rb', line 41 def autostart @autostart end |
#cpu_number ⇒ Object (readonly)
Returns the value of attribute cpu_number.
43 44 45 |
# File 'lib/archipel/api/vm/vm_info.rb', line 43 def cpu_number @cpu_number end |
#cpu_usage ⇒ Object (readonly)
Returns the value of attribute cpu_usage.
43 44 45 |
# File 'lib/archipel/api/vm/vm_info.rb', line 43 def cpu_usage @cpu_usage end |
#memory ⇒ Object (readonly)
Returns the value of attribute memory.
42 43 44 |
# File 'lib/archipel/api/vm/vm_info.rb', line 42 def memory @memory end |
#memory_max ⇒ Object (readonly)
Returns the value of attribute memory_max.
42 43 44 |
# File 'lib/archipel/api/vm/vm_info.rb', line 42 def memory_max @memory_max end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
40 41 42 |
# File 'lib/archipel/api/vm/vm_info.rb', line 40 def state @state end |