Class: Capybara::Accessible::Auditor
- Inherits:
-
Object
- Object
- Capybara::Accessible::Auditor
- Defined in:
- lib/capybara/accessible/auditor.rb
Class Method Summary collapse
- .disable ⇒ Object
- .disabled? ⇒ Boolean
- .enable ⇒ Object
- .exclusions ⇒ Object
- .exclusions=(rules) ⇒ Object
- .log_level ⇒ Object
- .log_level=(level) ⇒ Object
- .severe_rules ⇒ Object
- .severe_rules=(rules) ⇒ Object
Instance Method Summary collapse
- #audit! ⇒ Object
-
#initialize(driver) ⇒ Auditor
constructor
A new instance of Auditor.
Constructor Details
#initialize(driver) ⇒ Auditor
Returns a new instance of Auditor.
43 44 45 |
# File 'lib/capybara/accessible/auditor.rb', line 43 def initialize(driver) @driver = driver end |
Class Method Details
.disable ⇒ Object
30 31 32 |
# File 'lib/capybara/accessible/auditor.rb', line 30 def disable @disabled = true end |
.disabled? ⇒ Boolean
38 39 40 |
# File 'lib/capybara/accessible/auditor.rb', line 38 def disabled? @disabled end |
.enable ⇒ Object
34 35 36 |
# File 'lib/capybara/accessible/auditor.rb', line 34 def enable @disabled = false end |
.exclusions ⇒ Object
10 11 12 |
# File 'lib/capybara/accessible/auditor.rb', line 10 def exclusions @exclusions ||= [] end |
.exclusions=(rules) ⇒ Object
6 7 8 |
# File 'lib/capybara/accessible/auditor.rb', line 6 def exclusions=(rules) @exclusions = rules end |
.log_level ⇒ Object
18 19 20 |
# File 'lib/capybara/accessible/auditor.rb', line 18 def log_level @log_level ||= :error end |
.log_level=(level) ⇒ Object
14 15 16 |
# File 'lib/capybara/accessible/auditor.rb', line 14 def log_level=(level) @log_level = level end |
.severe_rules ⇒ Object
26 27 28 |
# File 'lib/capybara/accessible/auditor.rb', line 26 def severe_rules @severe_rules ||= [] end |
.severe_rules=(rules) ⇒ Object
22 23 24 |
# File 'lib/capybara/accessible/auditor.rb', line 22 def severe_rules=(rules) @severe_rules = rules end |
Instance Method Details
#audit! ⇒ Object
47 48 49 50 51 52 |
# File 'lib/capybara/accessible/auditor.rb', line 47 def audit! return if Auditor.disabled? if failures? log_level_response[::Accessible::Auditor.log_level].call() end end |