class Plugins::AroundStack::WrappedBlock

Attributes

block[R]
retval[R]

Public Class Methods

new(&block) click to toggle source
# File lib/plugins/around_stack.rb, line 86
def initialize(&block)
  @block = block
end

Public Instance Methods

call(call_stack, *args) click to toggle source

Call the wrapped block, ignoring the scope and call_stack arguments.

# File lib/plugins/around_stack.rb, line 96
def call(call_stack, *args)
  raise Errors::Error, 'receiving non-empty call stack' unless call_stack.empty?
  block.call(*args).tap { |retval|
    @retval = retval
    @_called = true
  }
end
called?() click to toggle source
# File lib/plugins/around_stack.rb, line 90
def called?
  !!@_called
end