Class: JsonApiClient::ErrorCollector
- Inherits:
-
Array
- Object
- Array
- JsonApiClient::ErrorCollector
- Defined in:
- lib/json_api_client/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.
65 66 67 68 69 |
# File 'lib/json_api_client/error_collector.rb', line 65 def initialize(error_data) super(error_data.map do |data| Error.new(data) end) end |
Instance Method Details
#[](source) ⇒ Object
75 76 77 78 79 |
# File 'lib/json_api_client/error_collector.rb', line 75 def [](source) map do |error| error.source_parameter == source end end |
#full_messages ⇒ Object
71 72 73 |
# File 'lib/json_api_client/error_collector.rb', line 71 def map(&:title) end |