class Deltacloud::BaseModel

Attributes

description[RW]
name[RW]

Public Class Methods

attr_accessor(*vars) click to toggle source
Calls superclass method
# File lib/deltacloud/models/base_model.rb, line 31
def self.attr_accessor(*vars)
  @attributes ||= [:id]
  @attributes.concat vars
  super
end
attributes() click to toggle source
# File lib/deltacloud/models/base_model.rb, line 37
def self.attributes
  @attributes
end
new(init=nil) click to toggle source
# File lib/deltacloud/models/base_model.rb, line 22
def initialize(init=nil)
  if ( init )
    @id=init[:id]
    init.each{|k,v|
      self.send( "#{k}=", v ) if ( self.respond_to?( "#{k}=" ) )
    }
  end
end

Public Instance Methods

attributes() click to toggle source
# File lib/deltacloud/models/base_model.rb, line 41
def attributes
  self.class.attributes
end
id() click to toggle source
# File lib/deltacloud/models/base_model.rb, line 45
def id
  @id
end
to_entity() click to toggle source
# File lib/deltacloud/models/base_model.rb, line 49
def to_entity
  self.class.name.downcase
end