class Axe::Configuration

Attributes

jslib[W]
jslib_path[RW]
page[RW]
skip_iframes[RW]

Public Class Methods

from_hash(attributes) click to toggle source
# File lib/axe/configuration.rb, line 41
def from_hash(attributes)
  attributes.each do |k, v|
    instance.__send__("#{k}=", v)
  end
  instance
end
from_yaml(path = "config/axe.yml") click to toggle source
# File lib/axe/configuration.rb, line 35
def from_yaml(path = "config/axe.yml")
  file = Pathname.new(path)
  from_hash(YAML.load_file(file)) if file.exist?
  instance
end
new() click to toggle source
# File lib/axe/configuration.rb, line 25
def initialize
  @page = :page
  @jslib_path = gem_root + '/node_modules/axe-core/axe.min.js'
end

Public Instance Methods

jslib() click to toggle source
# File lib/axe/configuration.rb, line 30
def jslib
  @jslib ||= Pathname.new(@jslib_path).read
end

Private Instance Methods

gem_root() click to toggle source
# File lib/axe/configuration.rb, line 51
def gem_root
  Gem::Specification.find_by_name('axe-matchers').gem_dir
end