Class: Decouplio::OptionsValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/decouplio/options_validator.rb

Instance Method Summary collapse

Constructor Details

#initialize(flow:, palps:, next_steps:, action_class:) ⇒ OptionsValidator

Returns a new instance of OptionsValidator.



36
37
38
39
40
41
# File 'lib/decouplio/options_validator.rb', line 36

def initialize(flow:, palps:, next_steps:, action_class:)
  @flow = flow
  @palps = palps
  @next_steps = next_steps
  @action_class = action_class
end

Instance Method Details

#callObject



43
44
45
46
47
48
49
# File 'lib/decouplio/options_validator.rb', line 43

def call
  @flow.each_with_index do |(_step_id, options), index|
    step_names = extract_step_names(flow: @flow.to_a[index..].to_h.merge(@next_steps || {}))

    validate(options: options, step_names: step_names)
  end
end