Class: Objective::Errors::ErrorArray

Inherits:
Array
  • Object
show all
Defined in:
lib/objective/errors/error_array.rb

Instance Method Summary collapse

Instance Method Details

#codesObject



6
7
8
# File 'lib/objective/errors/error_array.rb', line 6

def codes
  map { |e| e.try(:codes) }
end

#message(parent_key = nil, _index = nil) ⇒ Object



10
11
12
13
14
15
# File 'lib/objective/errors/error_array.rb', line 10

def message(parent_key = nil, _index = nil)
  each_with_index.map do |e, i|
    next if e.nil?
    e.message(parent_key, i)
  end
end

#message_list(parent_key = nil, _index = nil) ⇒ Object



17
18
19
20
21
22
# File 'lib/objective/errors/error_array.rb', line 17

def message_list(parent_key = nil, _index = nil)
  each_with_index.map do |e, i|
    next if e.nil?
    e.message_list(parent_key, i)
  end.flatten.compact
end