Sha256: 18c42a6a17ee5d43ea65733552ea017ca614df79e984faeb486fe25e881f637a

Contents?: true

Size: 689 Bytes

Versions: 70

Compression:

Stored size: 689 Bytes

Contents

module Axe
  module API
    class Selector
      def self.normalize(s)
        if s.is_a? Hash
          if s.key? :iframe and s.key? :selector
            Array(Selector.new s)
          else
            s
          end
        else
          Array(Selector.new s)
        end
      end

      def initialize(s)
        @selector = case s
                    when Array then s
                    when String, Symbol then [String(s)]
                    when Hash then Selector.new(s[:selector]).to_a.unshift s[:iframe]
                    else Selector.new(s.selector).to_a.unshift s.iframe
                    end
      end

      def to_a
        @selector
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
axe-core-api-4.10.1.pre.5294583 lib/axe/api/selector.rb
axe-core-api-4.10.2 lib/axe/api/selector.rb
axe-core-api-4.10.2.pre.2cca230 lib/axe/api/selector.rb
axe-core-api-4.10.1.pre.46a0052 lib/axe/api/selector.rb
axe-core-api-4.10.1.pre.7e72b19 lib/axe/api/selector.rb
axe-core-api-4.10.1.pre.5e15f96 lib/axe/api/selector.rb
axe-core-api-4.10.2.pre.5bd4e5c lib/axe/api/selector.rb
axe-core-api-4.10.1.pre.7bf959f lib/axe/api/selector.rb
axe-core-api-4.10.1 lib/axe/api/selector.rb
axe-core-api-4.10.0.pre.53569f6 lib/axe/api/selector.rb
axe-core-api-4.10.1.pre.7a3723a lib/axe/api/selector.rb
axe-core-api-4.10.0.pre.d102edb lib/axe/api/selector.rb
axe-core-api-4.9.1.pre.7a03090 lib/axe/api/selector.rb
axe-core-api-4.9.1.pre.1a5838a lib/axe/api/selector.rb
axe-core-api-4.10.0 lib/axe/api/selector.rb
axe-core-api-4.10.0.pre.5d7eac5 lib/axe/api/selector.rb
axe-core-api-4.9.1.pre.f16172e lib/axe/api/selector.rb
axe-core-api-4.9.1.pre.09e659e lib/axe/api/selector.rb
axe-core-api-4.9.1.pre.a80eeee lib/axe/api/selector.rb
axe-core-api-4.9.0.pre.a02013a lib/axe/api/selector.rb