diff --git a/lib/floe/workflow/choice_rule/matches.rb b/lib/floe/workflow/choice_rule/matches.rb index 3b5c8e1b..3e0cbb49 100644 --- a/lib/floe/workflow/choice_rule/matches.rb +++ b/lib/floe/workflow/choice_rule/matches.rb @@ -4,16 +4,10 @@ module Floe class Workflow class ChoiceRule class Matches < Floe::Workflow::ChoiceRule - def initialize(payload, *, **) - super - # NOTE: only StringMatches exists (so no Path option) - # Since this is static, we're converting it up front - @ref = Regexp.escape(@ref).gsub('\*', '.*?') - end - def true?(context, input) lhs = variable_value(context, input) - valid?(lhs) && lhs.match?(ref) + rhs = compare_value(context, input) + valid?(lhs) && lhs.match?(Regexp.escape(rhs).gsub('\*', '.*?')) end end end