Class: Blacksheep::ActionDecorator

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/blacksheep/action_decorator.rb

Instance Method Summary collapse

Instance Method Details

#__class__Class

Access to the decorators class - since original class is overwritten to return the model class.

Returns:

  • (Class)

    The class of the deocrator.

See Also:

  • Blacksheep::ActionDecorator.[[#class]


11
# File 'lib/blacksheep/action_decorator.rb', line 11

alias_method :__class__, :class

#classObject



13
14
15
# File 'lib/blacksheep/action_decorator.rb', line 13

def class
  __getobj__.class
end

#decorators_chaintype

Just for curiosity - get the decorators chain

Returns:

  • (type)
    description


21
22
23
24
25
26
# File 'lib/blacksheep/action_decorator.rb', line 21

def decorators_chain
  decorated = __getobj__
  chain = decorated.kind_of?(Blacksheep::ActionDecorator) ? decorated.decorators_chain : [ decorated.class ]

  chain.unshift(self.__class__)
end