Sha256: 1482fd37184e801036c7f3c22b8abe5781c027ea150d7843df9d6136accb65dc

Contents?: true

Size: 560 Bytes

Versions: 15

Compression:

Stored size: 560 Bytes

Contents

module Yao::Resources
  class Flavor < Base
    friendly_attributes :name, :vcpus, :disk, :swap
    map_attribute_to_attribute "os-flavor-access:is_public" => :public?
    map_attribute_to_attribute "OS-FLV-DISABLED:disabled"   => :disabled?

    def ram(unit='M')
      case unit
      when 'M'
        self["ram"]
      when 'G'
        self["ram"] / 1024.0
      end
    end
    alias memory ram

    self.service        = "compute"
    self.resource_name  = "flavor"
    self.resources_name = "flavors"
    self.resources_detail_available = true
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/flavor.rb
yao-0.13.3 lib/yao/resources/flavor.rb
yao-0.13.2 lib/yao/resources/flavor.rb
yao-0.13.1 lib/yao/resources/flavor.rb
yao-0.13.0 lib/yao/resources/flavor.rb
yao-0.12.0 lib/yao/resources/flavor.rb
yao-0.11.3 lib/yao/resources/flavor.rb
yao-0.11.2 lib/yao/resources/flavor.rb
yao-0.11.1 lib/yao/resources/flavor.rb
yao-0.11.0 lib/yao/resources/flavor.rb
yao-0.10.1 lib/yao/resources/flavor.rb
yao-0.10.0 lib/yao/resources/flavor.rb
yao-0.9.1 lib/yao/resources/flavor.rb
yao-0.9.0 lib/yao/resources/flavor.rb
yao-0.8.0 lib/yao/resources/flavor.rb