Module: Friendly::Document::Mixin

Included in:
Associations, Attributes, Convenience, Scoping, Storage
Defined in:
lib/friendly/document/mixin.rb

Instance Method Summary collapse

Instance Method Details

#included(klass) ⇒ Object

FIXME: I’m not in love with this. But, I also don’t think it’s the end of the world.



6
7
8
9
10
11
12
# File 'lib/friendly/document/mixin.rb', line 6

def included(klass)
  if klass.const_defined?(:ClassMethods, false)
    klass.const_get(:ClassMethods, false).send(:include, const_get(:ClassMethods))
  else
    klass.send(:extend, const_get(:ClassMethods))
  end
end