Sha256: 5618defd1c15a93291db4b302a43aae614ff1df48cac509c14f960a645c8bdf3
Contents?: true
Size: 496 Bytes
Versions: 2
Compression:
Stored size: 496 Bytes
Contents
module NxtSchema module Validators class Includes < Validator def initialize(target) @target = target end register_as :includes attr_reader :target def build lambda do |application, value| if value.include?(target) 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/includes.rb |
nxt_schema-1.0.0 | lib/nxt_schema/validators/includes.rb |