Module: Representable::ClassInclusions

Defined in:
lib/representable.rb

Instance Method Summary collapse

Instance Method Details

#included(base) ⇒ Object



74
75
76
77
# File 'lib/representable.rb', line 74

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?



79
80
81
82
# File 'lib/representable.rb', line 79

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