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
9
10
11
# File 'lib/objective/errors/error_array.rb', line 6

def codes
  map do |e|
    next unless e.respond_to?(:codes)
    e.codes
  end
end

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



13
14
15
16
17
18
# File 'lib/objective/errors/error_array.rb', line 13

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



20
21
22
23
24
25
# File 'lib/objective/errors/error_array.rb', line 20

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