Class: JsonApiClient::ErrorCollector

Inherits:
Array
  • Object
show all
Defined in:
lib/json_api_client/error_collector.rb

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

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_messagesObject



71
72
73
# File 'lib/json_api_client/error_collector.rb', line 71

def full_messages
  map(&:title)
end