Module: Lite::Decorator::Inference

Defined in:
lib/lite/decorator/inference.rb

Instance Method Summary collapse

Instance Method Details

#decoratorObject



13
14
15
# File 'lib/lite/decorator/inference.rb', line 13

def decorator
  @decorator ||= decorator_class&.new(self)
end

#decorator_classObject



7
8
9
10
11
# File 'lib/lite/decorator/inference.rb', line 7

def decorator_class
  return @decorator_class if defined?(@decorator_class)

  @decorator_class = "#{self.class.name}Decorator".safe_constantize
end