class Accessibility::Audit
An Accessibility::Audit
is in charge of parsing the rules found on the raw response from the access-lint-server, available on the Checker
, and filtering them by different criteria.
Public Class Methods
new(checker)
click to toggle source
# File lib/accessibility/audit.rb, line 9 def initialize(checker) @checker = checker end
Public Instance Methods
all()
click to toggle source
Returns all the rules
# File lib/accessibility/audit.rb, line 21 def all @rules ||= raw.values.flatten.map { |rule| Accessibility::Rule.new(rule) } end
errors()
click to toggle source
Returns the rules that failed with a severity of “Severe”
# File lib/accessibility/audit.rb, line 41 def errors @errors ||= failed.select { |rule| rule.severity == "Severe" } end
failed()
click to toggle source
Returns the rules that failed on the checked document
# File lib/accessibility/audit.rb, line 36 def failed @failed ||= all.select { |rule| rule.status == "FAIL" } end
not_applicable()
click to toggle source
Returns the rules that were not applicable to the checked document
# File lib/accessibility/audit.rb, line 26 def not_applicable @not_applicable ||= all.select { |rule| rule.status == "NA" } end
passed()
click to toggle source
Returns the rules that passed on the checked document
# File lib/accessibility/audit.rb, line 31 def passed @passed ||= all.select { |rule| rule.status == "PASS" } end
rules()
click to toggle source
# File lib/accessibility/audit.rb, line 16 def rules self end
warnings()
click to toggle source
Returns the rules that failed with a severity of “Warning”
# File lib/accessibility/audit.rb, line 46 def warnings @warnings ||= failed.select { |rule| rule.severity == "Warning" } end