Sha256: 2ae1dafe926a7b8c0a7fdefbbfb7bfbe8a4b0e708d850efc04ae79f27cb5007f
Contents?: true
Size: 507 Bytes
Versions: 5
Compression:
Stored size: 507 Bytes
Contents
require 'virtus' class StandaloneValidator class Violation include Virtus.value_object values do attribute :source_object, Object attribute :attribute, Symbol, :default => :base attribute :type, Symbol, :default => :invalid attribute :message, String, :default => nil attribute :options, Hash, :default => {} end def add_to(errors_object) errors_object.add(attribute, message || type, options) self end end end
Version data entries
5 entries across 5 versions & 1 rubygems