Class: Ribbon::Plugins::AroundStack::WrappedBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/ribbon/plugins/around_stack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ WrappedBlock

Returns a new instance of WrappedBlock.



53
54
55
# File 'lib/ribbon/plugins/around_stack.rb', line 53

def initialize(&block)
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



51
52
53
# File 'lib/ribbon/plugins/around_stack.rb', line 51

def block
  @block
end

Instance Method Details

#call(call_stack, *args) ⇒ Object

Raises:



57
58
59
60
# File 'lib/ribbon/plugins/around_stack.rb', line 57

def call(call_stack, *args)
  raise Errors::Error, 'receiving non-empty call stack' unless call_stack.empty?
  block.call(*args)
end