Module: Lite::Validation::Validator::Node::Implementation::Helpers::YieldStrategy

Defined in:
lib/lite/validation/validator/node/implementation/helpers/yield_strategy.rb

Defined Under Namespace

Modules: Nullify, Refute, Skip, YieldOption

Class Method Summary collapse

Class Method Details

.to_iterate(strategy) ⇒ Object



70
71
72
73
74
75
76
# File 'lib/lite/validation/validator/node/implementation/helpers/yield_strategy.rb', line 70

def self.to_iterate(strategy)
  case strategy
  when :skip then Skip
  when :refute then Refute
  else raise Error::Fatal, "Unexpected missing iteration strategy: #{strategy}"
  end
end

.to_yield(strategy) ⇒ Object



60
61
62
63
64
65
66
67
68
# File 'lib/lite/validation/validator/node/implementation/helpers/yield_strategy.rb', line 60

def self.to_yield(strategy)
  case strategy
  when :skip then Skip
  when :nullify then Nullify
  when :refute then Refute
  when :yield_option then YieldOption
  else raise Error::Fatal, "Unexpected missing yield strategy: #{strategy}"
  end
end