class NxtSchema::Validators::Excluded
Attributes
target[R]
Public Class Methods
new(target)
click to toggle source
# File lib/nxt_schema/validators/excluded_in.rb, line 4 def initialize(target) @target = target end
Public Instance Methods
build()
click to toggle source
# File lib/nxt_schema/validators/excluded_in.rb, line 11 def build lambda do |node, value| if target.exclude?(value) true else message = translate_error(node.locale, target: target, value: value) node.add_error(message) end end end