Method: CIMI::Service::Base.inherited

Defined in:
lib/cimi/service/base.rb

.inherited(subclass) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/cimi/service/base.rb', line 45

def inherited(subclass)
  # Decorate all the attributes of the model class
  schema = subclass.model_class.schema
  schema.attribute_names.each do |name|
    define_method(name) { self[name] }
    define_method(:"#{name}=") { |newval| self[name] = newval }
  end
end