Sha256: 48339f27d1dfc046ed3feb40a53b5f6bcc2a2ea4cb661bb702382e8cdcf7829d

Contents?: true

Size: 530 Bytes

Versions: 5

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true
module Browser
  class Generic < Base
    NAMES = {
      "QuickTime" => "QuickTime",
      "CoreMedia" => "Apple CoreMedia"
    }

    def id
      :generic
    end

    def name
      infer_name || "Generic Browser"
    end

    def full_version
      ua[%r[(?:QuickTime)/([\d.]+)], 1] ||
        ua[%r[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

5 entries across 5 versions & 1 rubygems

Version Path
browser-2.2.0 lib/browser/generic.rb
browser-2.1.0 lib/browser/generic.rb
browser-2.0.3 lib/browser/generic.rb
browser-2.0.2 lib/browser/generic.rb
browser-2.0.1 lib/browser/generic.rb