class Axe::API::Results

Public Instance Methods

failure_message() click to toggle source
# File lib/axe/api/results.rb, line 17
def failure_message
  [
    "",
    violation_count_message,
    "",
    violations_failure_messages
  ].flatten.join("\n")
end
to_h() click to toggle source
# File lib/axe/api/results.rb, line 26
def to_h
  {
    inapplicable: inapplicable.map(&:to_h),
    incomplete: incomplete.map(&:to_h),
    passes: passes.map(&:to_h),
    timestamp: timestamp,
    url: url,
    violations: violations.map(&:to_h)
  }
end

Private Instance Methods

violation_count_message() click to toggle source
# File lib/axe/api/results.rb, line 39
def violation_count_message
  "Found #{violations.count} accessibility #{violations.count == 1 ? 'violation' : 'violations'}:"
end
violations_failure_messages() click to toggle source
# File lib/axe/api/results.rb, line 43
def violations_failure_messages
  violations.each_with_index.map(&:failure_messages)
end