Class: JSONAPI::Consumer::ErrorCollector
- Inherits:
-
Array
- Object
- Array
- JSONAPI::Consumer::ErrorCollector
- Defined in:
- lib/jsonapi/consumer/error_collector.rb
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
- #[](source) ⇒ Object
- #full_messages ⇒ Object
-
#initialize(error_data) ⇒ ErrorCollector
constructor
A new instance of ErrorCollector.
Constructor Details
#initialize(error_data) ⇒ ErrorCollector
Returns a new instance of ErrorCollector.
74 75 76 77 78 |
# File 'lib/jsonapi/consumer/error_collector.rb', line 74 def initialize(error_data) super(error_data.map do |data| Error.new(data) end) end |
Instance Method Details
#[](source) ⇒ Object
84 85 86 87 88 |
# File 'lib/jsonapi/consumer/error_collector.rb', line 84 def [](source) map do |error| error.error_key == source end end |
#full_messages ⇒ Object
80 81 82 |
# File 'lib/jsonapi/consumer/error_collector.rb', line 80 def map(&:title) end |