Exception: Polyphony::Interjection
- Inherits:
-
BaseException
- Object
- Exception
- BaseException
- Polyphony::Interjection
- Defined in:
- lib/polyphony/core/exceptions.rb
Overview
Interjection is used to run arbitrary code on arbitrary fibers at any point
Instance Attribute Summary
Attributes inherited from BaseException
Attributes inherited from Exception
Instance Method Summary collapse
-
#initialize(proc) ⇒ Interjection
constructor
Initializes an Interjection with the given proc.
-
#invoke ⇒ Object
Invokes the exception by calling the associated proc.
Methods inherited from Exception
Constructor Details
#initialize(proc) ⇒ Interjection
Initializes an Interjection with the given proc.
43 44 45 |
# File 'lib/polyphony/core/exceptions.rb', line 43 def initialize(proc) @proc = proc end |
Instance Method Details
#invoke ⇒ Object
Invokes the exception by calling the associated proc.
48 49 50 |
# File 'lib/polyphony/core/exceptions.rb', line 48 def invoke @proc.call end |