Sha256: de1bbe154dd51fb36620752ba397687763625bd65542c4e1d75719a965565e83
Contents?: true
Size: 499 Bytes
Versions: 2
Compression:
Stored size: 499 Bytes
Contents
module NxtSchema module Validators class Included < Validator def initialize(target) @target = target end register_as :included_in attr_reader :target def build lambda do |application, value| if target.include?(value) true else message = translate_error(application.locale, value: value, target: target) application.add_error(message) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nxt_schema-1.0.1 | lib/nxt_schema/validators/included_in.rb |
nxt_schema-1.0.0 | lib/nxt_schema/validators/included_in.rb |