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
rackspace-fog-1.4.2 lib/rackspace-fog/vcloud/models/compute/helpers/status.rb
fog-1.4.0 lib/fog/vcloud/models/compute/helpers/status.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/helpers/status.rb
michiels-fog-1.3.1 lib/fog/vcloud/models/compute/helpers/status.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/vcloud/models/compute/helpers/status.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.3.1 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.3.0 lib/fog/vcloud/models/compute/helpers/status.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.2.0 lib/fog/vcloud/models/compute/helpers/status.rb
ktheory-fog-1.1.2 lib/fog/vcloud/models/compute/helpers/status.rb
fog-1.1.2 lib/fog/vcloud/models/compute/helpers/status.rb