Sha256: 7ef61338ad8028263660a6e669dea90c959a0c2b15b45b6c7a6aa1e740f0a333

Contents?: true

Size: 445 Bytes

Versions: 4

Compression:

Stored size: 445 Bytes

Contents

module PageMagic
  class Driver
    attr_reader :supported_browsers, :handler
    def initialize(*supported_browsers, &block)
      @handler = block
      @supported_browsers = supported_browsers
    end

    def support? browser
      supported_browsers.include?(browser)
    end

    def build(app, browser:, options:{})
      options[:browser] = browser
      driver_clazz = handler.call
      driver_clazz.new(app, options)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
page_magic-1.0.0.alpha4 lib/page_magic/driver.rb
page_magic-1.0.0.alpha3 lib/page_magic/driver.rb
page_magic-0.11.0.alpha8 lib/page_magic/driver.rb
page_magic-0.11.0.alpha7 lib/page_magic/driver.rb