Class: Capybara::Accessible::Auditor

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/accessible/auditor.rb

Class Method Summary collapse

Instance Method Summary collapse

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

.disableObject



30
31
32
# File 'lib/capybara/accessible/auditor.rb', line 30

def disable
  @disabled = true
end

.disabled?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/capybara/accessible/auditor.rb', line 38

def disabled?
  @disabled
end

.enableObject



34
35
36
# File 'lib/capybara/accessible/auditor.rb', line 34

def enable
  @disabled = false
end

.exclusionsObject



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_levelObject



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_rulesObject



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[Capybara::Accessible::Auditor.log_level].call(failure_messages)
  end
end