Module: Representable::ClassInclusions

Defined in:
lib/representable.rb

Instance Method Summary collapse

Instance Method Details

#included(base) ⇒ Object



86
87
88
89
# File 'lib/representable.rb', line 86

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?



91
92
93
94
# File 'lib/representable.rb', line 91

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