lib/dry/validation/error.rb in dry-validation-0.2.0 vs lib/dry/validation/error.rb in dry-validation-0.3.0
- old
+ new
@@ -4,23 +4,19 @@
class Set
include Enumerable
attr_reader :errors
- def initialize
- @errors = []
+ def initialize(errors)
+ @errors = errors
end
def each(&block)
errors.each(&block)
end
def empty?
errors.empty?
- end
-
- def <<(error)
- errors << error
end
def to_ary
errors.map { |error| error.to_ary }
end