Class: RubyODE::UseCase

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_ode/runtime.rb

Instance Method Summary collapse

Instance Method Details

#execute(_param) ⇒ Object

Raises:

  • (NotImplementedError)


50
51
52
# File 'lib/ruby_ode/runtime.rb', line 50

def execute(_param)
  raise NotImplementedError
end

#guard(_param) ⇒ Object



48
# File 'lib/ruby_ode/runtime.rb', line 48

def guard(_param); end

#on_error(error) ⇒ Object



58
59
60
# File 'lib/ruby_ode/runtime.rb', line 58

def on_error(error)
  Outputs.error(error)
end

#on_result(result) ⇒ Object



54
55
56
# File 'lib/ruby_ode/runtime.rb', line 54

def on_result(result)
  Outputs.value(result)
end

#process(param) ⇒ Object



41
42
43
44
45
46
# File 'lib/ruby_ode/runtime.rb', line 41

def process(param)
  guard(param)
  on_result(execute(param))
rescue StandardError => error
  on_error(error)
end