Class: Hipaapotamus::Execution
- Inherits:
-
Object
- Object
- Hipaapotamus::Execution
- Defined in:
- lib/hipaapotamus/execution.rb
Instance Method Summary collapse
-
#initialize ⇒ Execution
constructor
A new instance of Execution.
- #raised? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize ⇒ Execution
Returns a new instance of Execution.
3 4 5 6 7 8 9 10 11 |
# File 'lib/hipaapotamus/execution.rb', line 3 def initialize begin @value = yield @raised = false rescue StandardError => value @value = value @raised = true end end |
Instance Method Details
#raised? ⇒ Boolean
13 14 15 |
# File 'lib/hipaapotamus/execution.rb', line 13 def raised? @raised end |
#value ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/hipaapotamus/execution.rb', line 17 def value if raised? raise @value else @value end end |