Class: Vagrant::LXC::MachineState
- Inherits:
-
MachineState
- Object
- MachineState
- Vagrant::LXC::MachineState
- Defined in:
- lib/vagrant-lxc/machine_state.rb
Constant Summary collapse
- CREATED_STATES =
%w( running stopped ).map!(&:to_sym)
Instance Method Summary collapse
- #created? ⇒ Boolean
-
#initialize(state_id) ⇒ MachineState
constructor
A new instance of MachineState.
- #off? ⇒ Boolean
- #running? ⇒ Boolean
Constructor Details
#initialize(state_id) ⇒ MachineState
Returns a new instance of MachineState.
6 7 8 9 10 |
# File 'lib/vagrant-lxc/machine_state.rb', line 6 def initialize(state_id) short = state_id.to_s.gsub("_", " ") long = I18n.t("vagrant.commands.status.#{state_id}") super(state_id, short, long) end |
Instance Method Details
#created? ⇒ Boolean
12 13 14 |
# File 'lib/vagrant-lxc/machine_state.rb', line 12 def created? CREATED_STATES.include?(self.id) end |
#off? ⇒ Boolean
16 17 18 |
# File 'lib/vagrant-lxc/machine_state.rb', line 16 def off? self.id == :stopped end |
#running? ⇒ Boolean
20 21 22 |
# File 'lib/vagrant-lxc/machine_state.rb', line 20 def running? self.id == :running end |