Class: ErrorBuilder::Formats::Hash
- Defined in:
- lib/error_builder/formats/hash.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from ErrorBuilder::Formats::Base
Instance Method Details
#to_h ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/error_builder/formats/hash.rb', line 6 def to_h errors.each_with_object({}) do |error, hash| keys = flat ? [error.key] : error.keys add_nested_key(hash, keys, error.) end end |