Sha256: 1db675b4880a59edcbcd3899636e114a6e87fc765cc1e1b9b5e64691296d944b
Contents?: true
Size: 947 Bytes
Versions: 9
Compression:
Stored size: 947 Bytes
Contents
class UserAgent module Browsers module All include Comparable def <=>(other) if respond_to?(:browser) && other.respond_to?(:browser) && browser == other.browser version <=> other.version else false end end def eql?(other) self == other end def to_s to_str end def to_str join(" ") end def application first end def browser application.product end def version application.version end def respond_to?(symbol) detect_product(symbol) ? true : super end def method_missing(method, *args, &block) detect_product(method) || super end private def detect_product(product) detect { |useragent| useragent.product.to_s.downcase == product.to_s.downcase } end end end end
Version data entries
9 entries across 9 versions & 2 rubygems