Class: VagrantPlugins::AVF::Model::MachineState

Inherits:
Vagrant::MachineState
  • Object
show all
Defined in:
lib/vagrant_provider_avf/model/machine_state.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, short_description:, long_description:) ⇒ MachineState

Returns a new instance of MachineState.



45
46
47
# File 'lib/vagrant_provider_avf/model/machine_state.rb', line 45

def initialize(id, short_description:, long_description:)
  super(id, short_description, long_description)
end

Class Method Details

.for(state) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/vagrant_provider_avf/model/machine_state.rb', line 37

def self.for(state)
  return not_created if state.to_sym == :not_created
  return running if state.to_sym == :running
  return stopped if state.to_sym == :stopped

  unknown
end

.not_createdObject



5
6
7
8
9
10
11
# File 'lib/vagrant_provider_avf/model/machine_state.rb', line 5

def self.not_created
  new(
    :not_created,
    short_description: "not created",
    long_description: "The machine has not been created."
  )
end

.runningObject



21
22
23
24
25
26
27
# File 'lib/vagrant_provider_avf/model/machine_state.rb', line 21

def self.running
  new(
    :running,
    short_description: "running",
    long_description: "The machine is running."
  )
end

.stoppedObject



29
30
31
32
33
34
35
# File 'lib/vagrant_provider_avf/model/machine_state.rb', line 29

def self.stopped
  new(
    :stopped,
    short_description: "stopped",
    long_description: "The machine has been created, but it is not running."
  )
end

.unknownObject



13
14
15
16
17
18
19
# File 'lib/vagrant_provider_avf/model/machine_state.rb', line 13

def self.unknown
  new(
    :unknown,
    short_description: "unknown",
    long_description: "The machine exists, but its AVF state has not been implemented yet."
  )
end