Sha256: b24411f111570ad0b7a182986f12b5692bcfb0df5176cc65bb9777ce74a30a27
Contents?: true
Size: 696 Bytes
Versions: 15
Compression:
Stored size: 696 Bytes
Contents
module Dry module Validation class MessageCompiler class VisitorOpts < Hash def self.new opts = super opts[:path] = EMPTY_ARRAY opts[:rule] = nil opts[:message_type] = :failure opts end def path? ! path.empty? end def path self[:path] end def rule self[:rule] end def with_rule(new_rule, **other) opts = dup opts[:rule] = new_rule unless opts.rule opts.(other) end def call(other) merge(other.update(path: [*path, *other[:path]])) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems