Module: HALDecorator::Model

Included in:
HALDecorator
Defined in:
lib/hal_decorator/model.rb

Instance Method Summary collapse

Instance Method Details

#inherited(subclass) ⇒ Object



27
28
29
30
31
32
# File 'lib/hal_decorator/model.rb', line 27

def inherited(subclass)
  if model = HALDecorator.lookup_model(self)
    HALDecorator.register(model: model, decorator: subclass)
  end
  super
end

#model(clazz) ⇒ Object



23
24
25
# File 'lib/hal_decorator/model.rb', line 23

def model(clazz)
  HALDecorator.register(model: clazz, decorator: self)
end