We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0f18b0 commit beecec3Copy full SHA for beecec3
ruby/hyper-operation/lib/hyper-operation/exception.rb
@@ -1,9 +1,11 @@
1
module Mutations
2
- class ErrorArray
+ class ErrorHash
3
def self.new_from_error_hash(errors)
4
- new(errors.collect do |key, values|
5
- ErrorAtom.new(key, values[:symbol], values)
6
- end)
+ new.tap do |hash|
+ errors.each do |key, values|
+ hash[key] = ErrorAtom.new(key, values[:symbol], values)
7
+ end
8
9
end
10
11
@@ -30,7 +32,7 @@ def as_json(*)
30
32
31
33
def initialize(errors)
34
unless errors.is_a? Mutations::ErrorHash
- errors = Mutations::ErrorArray.new_from_error_hash(errors)
35
+ errors = Mutations::ErrorHash.new_from_error_hash(errors)
36
37
super(errors)
38
0 commit comments