Class: Axe::API::Results::Rule

Inherits:
ValueObject show all
Defined in:
lib/axe/api/results/rule.rb

Instance Method Summary collapse

Instance Method Details

#failure_messages(index) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/axe/api/results/rule.rb', line 18

def failure_messages(index)
  [
    title_message(index + 1),
    *[
      helpUrl,
      node_count_message,
      "",
      nodes.reject { |n| n.nil? }.map(&:failure_messages).map { |n| n.push("") }.flatten.map(&indent),
    ].flatten.map(&indent),
  ]
end

#to_hObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/axe/api/results/rule.rb', line 30

def to_h
  {
    description: description,
    help: help,
    helpUrl: helpUrl,
    id: id,
    impact: impact,
    nodes: nodes.map(&:to_h),
    tags: tags,
  }
end