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.


74
75
76
77
78
# File 'lib/json_api_client/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/json_api_client/error_collector.rb', line 84

def [](source)
  map do |error|
    error.error_key == source
  end
end

#full_messagesObject


80
81
82
# File 'lib/json_api_client/error_collector.rb', line 80

def full_messages
  map(&:title)
end