Sha256: f2dfd43bc1bad8d9d29000b74290a476173b9fc498255605c84790531956a69a

Contents?: true

Size: 531 Bytes

Versions: 8

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

module Browser
  class Generic < Base
    NAMES = {
      "QuickTime" => "QuickTime",
      "CoreMedia" => "Apple CoreMedia"
    }.freeze

    def id
      :generic
    end

    def name
      infer_name || "Generic Browser"
    end

    def full_version
      ua[%r{(?:QuickTime)/([\d.]+)}, 1] ||
        ua[/CoreMedia v([\d.]+)/, 1] ||
        "0.0"
    end

    def match?
      true
    end

    private def infer_name
      (NAMES.find {|key, _| ua.include?(key) } || []).last
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
browser-4.2.0 lib/browser/generic.rb
browser-4.1.0 lib/browser/generic.rb
browser-4.0.0 lib/browser/generic.rb
browser-3.0.3 lib/browser/generic.rb
browser-3.0.2 lib/browser/generic.rb
browser-3.0.1 lib/browser/generic.rb
browser-3.0.0 lib/browser/generic.rb
browser-2.7.1 lib/browser/generic.rb