class Plumb::Policy

can define dedicated handlers for policies, if they need to.
So that visitors such as JSONSchema and Metadata visitors
Wrap a policy composition (“step”) in a Policy object.

def ==(other)

def ==(other)
  other.is_a?(self.class) &&
    policy_name == other.policy_name &&
    arg == other.arg
end

def _inspect = @step.inspect

def _inspect = @step.inspect

def call(result) = @step.call(result)

Returns:
  • (Result::Valid, Result::Invalid) -

Parameters:
  • result (Result::Valid) --
def call(result) = @step.call(result)

def initialize(policy_name, arg, step)

Parameters:
  • step (Step) -- the step composition wrapped by this policy.
  • arg (Object, nil) -- the argument to the policy, if any.
  • policy_name (Symbol) --
def initialize(policy_name, arg, step)
  @policy_name = policy_name
  @arg = arg
  @step = step
  @children = [step].freeze
  freeze
end