Class: RubyODE::SequenceUseCase

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

Instance Method Summary collapse

Constructor Details

#initialize(step:) ⇒ SequenceUseCase

Returns a new instance of SequenceUseCase.



81
82
83
# File 'lib/ruby_ode/runtime.rb', line 81

def initialize(step:)
  @step = step
end

Instance Method Details

#process(values) ⇒ Object



85
86
87
88
89
90
91
# File 'lib/ruby_ode/runtime.rb', line 85

def process(values)
  return Outputs.empty if values.empty?

  Outputs.value(values.map { |value| @step.call(value) })
rescue StandardError => error
  Outputs.error(error)
end