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-1.18.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.17.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.16.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/vcloud/models/compute/helpers/status.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.15.0 lib/fog/vcloud/models/compute/helpers/status.rb
gapinc-fog-1.14.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.14.0 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.13.0 lib/fog/vcloud/models/compute/helpers/status.rb
gapinc-fog-1.12.1.2 lib/fog/vcloud/models/compute/helpers/status.rb
gapinc-fog-1.12.1.1 lib/fog/vcloud/models/compute/helpers/status.rb
gapinc-fog-1.12.1a lib/fog/vcloud/models/compute/helpers/status.rb
gapinc-fog-1.12.1 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.12.1 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.12.0 lib/fog/vcloud/models/compute/helpers/status.rb
hpfog-0.0.20 lib/fog/vcloud/models/compute/helpers/status.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/vcloud/models/compute/helpers/status.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/vcloud/models/compute/helpers/status.rb
fog-nirvanix-1.8.2 lib/fog/vcloud/models/compute/helpers/status.rb