Parent

Class/Module Index [+]

Quicksearch

InstanceProfile

Model to store the hardware profile applied to an instance together with any instance-specific overrides

Attributes

architecture[RW]
cpu[RW]
memory[RW]
storage[RW]

Public Class Methods

new(hwp_name, args = {}) click to toggle source
# File lib/deltacloud/models/instance_profile.rb, line 26
def initialize(hwp_name, args = {})
  opts = args.inject({ :id => hwp_name.to_s }) do |m, e|
    k, v = e
    m[$1] = v if k.to_s =~ /^hwp_(.*)$/
    m
  end
  super(opts)
end

Public Instance Methods

name() click to toggle source
# File lib/deltacloud/models/instance_profile.rb, line 35
def name
  id
end
overrides() click to toggle source
# File lib/deltacloud/models/instance_profile.rb, line 43
def overrides
  [:memory, :storage, :architecture, :cpu].inject({}) do |h, p|
    if v = instance_variable_get("@#{p}")
      h[p] = v
    end
    h
  end
end
to_s() click to toggle source
# File lib/deltacloud/models/instance_profile.rb, line 39
def to_s
  name
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.