Sha256: b06b7b5abbbd2d795794771b1c070a399e2e5a4231e96dcfb5886b5ee4f21bc3

Contents?: true

Size: 1.66 KB

Versions: 63

Compression:

Stored size: 1.66 KB

Contents

module Vagrant
  # 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 can 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.
  class MachineState
    # This is a special ID that can be set for the state ID that
    # tells Vagrant that the machine is not created. If this is the
    # case, then Vagrant will set the ID to nil which will automatically
    # clean out the machine data directory.
    NOT_CREATED_ID = :not_created

    # Unique ID for this state.
    #
    # @return [Symbol]
    attr_reader :id

    # Short description for this state.
    #
    # @return [String]
    attr_reader :short_description

    # Long description for this state.
    #
    # @return [String]
    attr_reader :long_description

    # Creates a new instance to represent the state of a machine.
    #
    # @param [Symbol] id Unique identifier for this state.
    # @param [String] short Short (preferably one-word) description of
    #   the state.
    # @param [String] long Long description (can span multiple lines)
    #   of the state.
    def initialize(id, short, long)
      @id                = id
      @short_description = short
      @long_description  = long
    end
  end
end

Version data entries

63 entries across 56 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.0.0 lib/vagrant/machine_state.rb
vagrant-unbundled-2.1.4.0 lib/vagrant/machine_state.rb
vagrant-unbundled-2.1.2.0 lib/vagrant/machine_state.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/machine_state.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/machine_state.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/machine_state.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/machine_state.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/machine_state.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/lib/vagrant/machine_state.rb
vagrant-unbundled-2.1.1.0 lib/vagrant/machine_state.rb
vagrant-unbundled-2.0.4.0 lib/vagrant/machine_state.rb
vagrant-unbundled-2.0.3.0 lib/vagrant/machine_state.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/lib/vagrant/machine_state.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/lib/vagrant/machine_state.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/lib/vagrant/machine_state.rb
vagrant-unbundled-2.0.2.0 lib/vagrant/machine_state.rb
vagrant-unbundled-2.0.1.0 lib/vagrant/machine_state.rb
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/lib/vagrant/machine_state.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/lib/vagrant/machine_state.rb
vagrant-unbundled-2.0.0.1 lib/vagrant/machine_state.rb