Sha256: 9da482db7d40c5a82fc9fa8dab733964ece7e915c54adab4ff88c15e91c8b677
Contents?: true
Size: 719 Bytes
Versions: 13
Compression:
Stored size: 719 Bytes
Contents
# frozen_string_literal: true module Browser module Meta def self.rules @rules ||= [ Device, GenericBrowser, Id, IE, IOS, Mobile, Modern, Platform, Proxy, Safari, Tablet, Webkit ] end def self.get(browser) rules.each_with_object(Set.new) do |rule, meta| meta.merge(rule.new(browser).to_a) end.to_a end class Base # Set the browser instance. attr_reader :browser def initialize(browser) @browser = browser end def meta nil end def to_a meta.to_s.squeeze(" ").split(" ") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems