Class: Ribbon::Plugins::AroundStack::WrappedBlock
- Inherits:
-
Object
- Object
- Ribbon::Plugins::AroundStack::WrappedBlock
- Defined in:
- lib/ribbon/plugins/around_stack.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #call(call_stack, *args) ⇒ Object
-
#initialize(&block) ⇒ WrappedBlock
constructor
A new instance of WrappedBlock.
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
#block ⇒ Object (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
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 |