Sha256: 8cbc087e275143d172e3e334426c6d38a8df911c7d2690147a319803cbadb27a

Contents?: true

Size: 686 Bytes

Versions: 132

Compression:

Stored size: 686 Bytes

Contents

module Fog
  module Vcloud
    class Compute
      module Helpers
        module Status
          def friendly_status
            load_unless_loaded!
            case status
              when '0'
            'creating'
              when '8'
            'off'
              when '4'
            'on'
            else
            'unknown'
            end
          end

          def on?
            reload_status
            status == '4'
          end

          def off?
            reload_status
            status == '8'
          end

          def reload_status
            reload # always ensure we have the correct status
          end
        end
      end
    end
  end
end

Version data entries

132 entries across 130 versions & 21 rubygems

Version Path
fog-2.3.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-ifeel-2.2.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-2.2.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-2.1.0 lib/fog/vcloud/models/compute/helpers/status.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/vcloud/models/compute/helpers/status.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/vcloud/models/compute/helpers/status.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.42.1 lib/fog/vcloud/models/compute/helpers/status.rb
fog-2.0.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.42.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.41.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.40.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.39.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.38.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.37.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.36.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.35.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-2.0.0.pre.0 lib/fog/vcloud/models/compute/helpers/status.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.34.0 lib/fog/vcloud/models/compute/helpers/status.rb