Class: Accessibility::Rule
- Inherits:
-
Object
- Object
- Accessibility::Rule
- Defined in:
- lib/accessibility/rule.rb
Instance Attribute Summary collapse
-
#element_names ⇒ Object
readonly
Returns the value of attribute element_names.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(data) ⇒ Rule
constructor
An Accessibility::Rule represents a single Accessibility Developer Tools audit rule that is checked on the document.
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_names ⇒ Object (readonly)
Returns the value of attribute element_names.
3 4 5 |
# File 'lib/accessibility/rule.rb', line 3 def element_names @element_names end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
3 4 5 |
# File 'lib/accessibility/rule.rb', line 3 def severity @severity end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/accessibility/rule.rb', line 3 def status @status end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/accessibility/rule.rb', line 3 def title @title end |