Class: Accessibility::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/accessibility/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Rule

An Accessibility::Rule represents a single Accessibility Developer Tools audit rule that is checked on the document.

A Rule has the following attributes:

* status, which can be "NA" (not applicable), "PASS", or "FAIL"
* severity, which can be "Severe" or "Warning"
* title, which is a description of the rule
* element_names, an array of strings, each of them being a snippet of
                 the document where the issue was found


17
18
19
20
21
22
# File 'lib/accessibility/rule.rb', line 17

def initialize(data)
  @element_names = data['element_names']
  @severity      = data['severity']
  @status        = data['status']
  @title         = data['title']
end

Instance Attribute Details

#element_namesObject (readonly)

Returns the value of attribute element_names.



3
4
5
# File 'lib/accessibility/rule.rb', line 3

def element_names
  @element_names
end

#severityObject (readonly)

Returns the value of attribute severity.



3
4
5
# File 'lib/accessibility/rule.rb', line 3

def severity
  @severity
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/accessibility/rule.rb', line 3

def status
  @status
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/accessibility/rule.rb', line 3

def title
  @title
end