Class: VagrantPlugins::Utm::Model::ListResult::ListResultItem

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_utm/model/list_result.rb

Overview

Represents an item in the list result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ListResultItem

Initialize the result from raw data.

Parameters:

  • data (Hash)

    The 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

#nameString

Returns The name of the machine.

Returns:

  • (String)

    The name of the machine.



50
51
52
# File 'lib/vagrant_utm/model/list_result.rb', line 50

def name
  @name
end

#stateString

Returns The state of the machine.

Returns:

  • (String)

    The state of the machine.



52
53
54
# File 'lib/vagrant_utm/model/list_result.rb', line 52

def state
  @state
end

#uuidString

Returns The UUID of the machine.

Returns:

  • (String)

    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_stateObject

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