class Axe::API::Results::CheckedNode

Public Instance Methods

failure_messages() click to toggle source
Calls superclass method
# File lib/axe/api/results/checked_node.rb, line 18
def failure_messages
  [
    super,
    fix(all, "Fix all of the following:"),
    fix(none, "Fix all of the following:"),
    fix(any, "Fix any of the following:"),
  ]
end
to_h() click to toggle source
# File lib/axe/api/results/checked_node.rb, line 27
def to_h
  {
    all: all.map(&:to_h),
    any: any.map(&:to_h),
    failureSummary: failureSummary,
    html: html,
    impact: impact,
    none: none.map(&:to_h),
    target: target
  }
end

Private Instance Methods

fix(checks, message) click to toggle source
# File lib/axe/api/results/checked_node.rb, line 41
def fix(checks, message)
  valid_checks = checks.reject { |c| c.nil? }
  [
    (message unless valid_checks.empty?),
    valid_checks.map(&:failure_message).map { |line| line.prepend("- ") }
  ].compact
end