Class: Axe::API::Results

Inherits:
ValueObject show all
Defined in:
lib/axe/api/results.rb,
lib/axe/api/results/node.rb,
lib/axe/api/results/rule.rb,
lib/axe/api/results/check.rb,
lib/axe/api/results/checked_node.rb

Defined Under Namespace

Classes: Check, CheckedNode, Node, Rule

Instance Method Summary collapse

Instance Method Details

#failure_messageObject



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

def failure_message
  [
    "",
    violation_count_message,
    "",
    violations_failure_messages,
  ].flatten.join("\n")
end

#timestamp=(ts) ⇒ Object



42
43
44
# File 'lib/axe/api/results.rb', line 42

def timestamp=(ts)
  @timestamp = ts
end

#to_hObject



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

def to_h
  {
    inapplicable: inapplicable.map(&:to_h),
    incomplete: incomplete.map(&:to_h),
    passes: passes.map(&:to_h),
    testEngine: testEngine,
    timestamp: timestamp,
    url: url,
    violations: violations.map(&:to_h),
  }
end