Module: Representable::ClassInclusions

Defined in:
lib/representable.rb

Instance Method Summary collapse

Instance Method Details

#included(base) ⇒ Object



72
73
74
75
# File 'lib/representable.rb', line 72

def included(base)
  super
  base.inherit_module!(self)
end

#inherited(base) ⇒ Object

DISCUSS: this could be in Decorator? but then we couldn’t do B < A(include X) for non-decorators, right?



77
78
79
80
# File 'lib/representable.rb', line 77

def inherited(base) # DISCUSS: this could be in Decorator? but then we couldn't do B < A(include X) for non-decorators, right?
  super
  base.representable_attrs.inherit!(representable_attrs) # this should be inherit_class!
end