Module: Tramp::AttributeMethods::ClassMethods

Defined in:
lib/tramp/attribute_methods.rb

Instance Method Summary collapse

Instance Method Details

#attribute(name, options = {}) ⇒ Object



22
23
24
# File 'lib/tramp/attribute_methods.rb', line 22

def attribute(name, options = {})
  write_inheritable_hash(:model_attributes, {name => Attribute.new(name, self, options)})
end

#define_attribute_methods(force = false) ⇒ Object



26
27
28
29
30
# File 'lib/tramp/attribute_methods.rb', line 26

def define_attribute_methods(force = false)
  return unless model_attributes
  undefine_attribute_methods if force
  super(model_attributes.keys)
end