Class: VagrantPlugins::Utm::Model::ListResult::ListResultItem
- Inherits:
-
Object
- Object
- VagrantPlugins::Utm::Model::ListResult::ListResultItem
- Defined in:
- lib/vagrant_utm/model/list_result.rb
Overview
Represents an item in the list result.
Instance Attribute Summary collapse
-
#name ⇒ String
The name of the machine.
-
#state ⇒ String
The state of the machine.
-
#uuid ⇒ String
The UUID of the machine.
Instance Method Summary collapse
-
#initialize(data) ⇒ ListResultItem
constructor
Initialize the result from raw data.
-
#vagrant_state ⇒ Object
Returns the state of the machine using Vagrant symbols.
Constructor Details
#initialize(data) ⇒ ListResultItem
Initialize the result from raw data.
56 57 58 59 60 |
# File 'lib/vagrant_utm/model/list_result.rb', line 56 def initialize(data) @uuid = data["UUID"] @name = data["Name"] @state = data["Status"] end |
Instance Attribute Details
#name ⇒ String
Returns The name of the machine.
50 51 52 |
# File 'lib/vagrant_utm/model/list_result.rb', line 50 def name @name end |
#state ⇒ String
Returns The state of the machine.
52 53 54 |
# File 'lib/vagrant_utm/model/list_result.rb', line 52 def state @state end |
#uuid ⇒ String
Returns The UUID of the machine.
48 49 50 |
# File 'lib/vagrant_utm/model/list_result.rb', line 48 def uuid @uuid end |
Instance Method Details
#vagrant_state ⇒ Object
Returns the state of the machine using Vagrant symbols.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/vagrant_utm/model/list_result.rb', line 63 def vagrant_state case @state when "running" :running when "stopped", "suspended" :stopped else :host_state_unknown end end |