Class: Hipaapotamus::Execution

Inherits:
Object
  • Object
show all
Defined in:
lib/hipaapotamus/execution.rb

Instance Method Summary collapse

Constructor Details

#initializeExecution

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

Returns:

  • (Boolean)


13
14
15
# File 'lib/hipaapotamus/execution.rb', line 13

def raised?
  @raised
end

#valueObject



17
18
19
20
21
22
23
# File 'lib/hipaapotamus/execution.rb', line 17

def value
  if raised?
    raise @value
  else
    @value
  end
end