Sha256: 3dbff9d9ae69483443a373b7b501d737bc6f5e3f69bbc37ad6ce813141caeea1
Contents?: true
Size: 645 Bytes
Versions: 34
Compression:
Stored size: 645 Bytes
Contents
require_relative "./selector" module Axe module API class Context def initialize @inclusion = [] @exclusion = [] end def within(*selectors) @inclusion.concat selectors.map { |s| Array(Selector.new s) } end def excluding(*selectors) @exclusion.concat selectors.map { |s| Array(Selector.new s) } end def to_hash { include: @inclusion, exclude: @exclusion } .reject { |k, v| v.empty? } end def to_json to_hash.to_json end def empty? to_hash.empty? end alias :to_s :to_json end end end
Version data entries
34 entries across 34 versions & 1 rubygems