Sha256: a1fbbf01072f3237a68babeade1ee41a109be3b47995f41616623cb86b1bf6f5
Contents?: true
Size: 721 Bytes
Versions: 6
Compression:
Stored size: 721 Bytes
Contents
module Lotus module Validations # Validate given validations and return a set of errors # # @since 0.2.2 # @api private class Validator def initialize(validation_set, attributes, errors) @validation_set = validation_set @attributes = attributes @errors = errors end # @since 0.2.2 # @api private def validate @errors.clear @validation_set.each do |name, validations| value = @attributes[name] value = @attributes[name.to_s] if value.nil? attribute = Attribute.new(@attributes, name, value, validations, @errors) attribute.validate end @errors end end end end
Version data entries
6 entries across 6 versions & 1 rubygems