Class: ActiveModel::BetterErrors::MachineHashReporter
- Inherits:
-
HashReporter
- Object
- Reporter
- HashReporter
- ActiveModel::BetterErrors::MachineHashReporter
- Defined in:
- lib/active_model/better_errors/machine_hash_reporter.rb
Overview
MachineHashReporter
Instance Attribute Summary
Attributes inherited from Reporter
Instance Method Summary collapse
Methods inherited from Reporter
Constructor Details
This class inherits a constructor from ActiveModel::BetterErrors::Reporter
Instance Method Details
#format_error_message(error_message) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/active_model/better_errors/machine_hash_reporter.rb', line 19 def () result = {} result[:type] = .type || :invalid = . result[:options] = unless .blank? result end |
#to_hash ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/active_model/better_errors/machine_hash_reporter.rb', line 9 def to_hash collection.to_hash.reduce({}) do |hash, kv| attribute, = kv hash[attribute] = .map do || () end hash end end |