Module: Lycra::Attributes

Defined in:
lib/lycra/attributes.rb,
lib/lycra/attributes/attribute.rb,
lib/lycra/attributes/collection.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Attribute, Collection

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/lycra/attributes.rb', line 6

def self.included(base)
  base.send :attr_reader, :resolved
  base.send :attr_accessor, :subject
  base.send :extend, ClassMethods
  base.send :include, InstanceMethods

  base.class_eval do
    # TODO only for activerecord models??
    attribute! :id, types.integer
  end
end