Module: Magic::Decoratable

Extended by:
ActiveSupport::Concern, ClassMethods
Included in:
Magic::Decorator::Base
Defined in:
lib/magic/decoratable.rb

Instance Method Summary collapse

Instance Method Details

#decorateObject



18
# File 'lib/magic/decoratable.rb', line 18

def decorate   = decorator&.new self

#decorate!Object



19
# File 'lib/magic/decoratable.rb', line 19

def decorate!  = decorate || raise(Lookup::Error.for self, decorator_base)

#decoratedObject



20
# File 'lib/magic/decoratable.rb', line 20

def decorated  = decorate || self

#decorated?Boolean

Returns:

  • (Boolean)


21
# File 'lib/magic/decoratable.rb', line 21

def decorated? = false