Class: Vagrant::MachineState
- Inherits:
-
Object
- Object
- Vagrant::MachineState
- Defined in:
- lib/vagrant/machine_state.rb
Overview
This represents the state of a given machine. This is a very basic class that simply stores a short and long description of the state of a machine.
The state also stores a state “id” which ca be used as a unique identifier for a state. This should be a symbol. This allows internal code to compare state such as “:not_created” instead of using string comparison.
The short description should be a single word description of the state of the machine such as “running” or “not created”.
The long description can span multiple lines describing what the state actually means.
Instance Attribute Summary collapse
-
#id ⇒ Symbol
readonly
Unique ID for this state.
-
#long_description ⇒ String
readonly
Long description for this state.
-
#short_description ⇒ String
readonly
Short description for this state.
Instance Method Summary collapse
-
#initialize(id, short, long) ⇒ MachineState
constructor
Creates a new instance to represent the state of a machine.
Constructor Details
#initialize(id, short, long) ⇒ MachineState
Creates a new instance to represent the state of a machine.
39 40 41 42 43 |
# File 'lib/vagrant/machine_state.rb', line 39 def initialize(id, short, long) @id = id @short_description = short @long_description = long end |
Instance Attribute Details
#id ⇒ Symbol (readonly)
Unique ID for this state.
20 21 22 |
# File 'lib/vagrant/machine_state.rb', line 20 def id @id end |
#long_description ⇒ String (readonly)
Long description for this state.
30 31 32 |
# File 'lib/vagrant/machine_state.rb', line 30 def long_description @long_description end |
#short_description ⇒ String (readonly)
Short description for this state.
25 26 27 |
# File 'lib/vagrant/machine_state.rb', line 25 def short_description @short_description end |