class Deltacloud::InstanceProfile

Attributes

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

Public Class Methods

new(hwp_name, args = {}) click to toggle source
Calls superclass method Deltacloud::BaseModel.new
# File lib/deltacloud/models/instance_profile.rb, line 27
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 36
def name
  id
end
override?(property) click to toggle source
# File lib/deltacloud/models/instance_profile.rb, line 44
def override?(property)
  overrides.find { |p, v| p == property }
end
overrides() click to toggle source
# File lib/deltacloud/models/instance_profile.rb, line 48
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 40
def to_s
  name
end