Class: Browser::Safari

Inherits:
Base
  • Object
show all
Defined in:
lib/browser/safari.rb

Instance Attribute Summary

Attributes inherited from Base

#accept_language, #ua

Instance Method Summary collapse

Methods inherited from Base

#alipay?, #bot, #bot?, #chrome?, #compatibility_view?, #core_media?, #device, #edge?, #electron?, #facebook?, #firefox?, #ie?, #initialize, #known?, #meta, #micro_messenger?, #modern?, #msie_full_version, #msie_version, #nokia?, #opera?, #opera_mini?, #otter?, #phantom_js?, #platform, #proxy?, #quicktime?, #safari?, #safari_webapp_mode?, #to_s, #uc_browser?, #version, #webkit?, #webkit_full_version, #weibo?, #yandex?

Constructor Details

This class inherits a constructor from Browser::Base

Instance Method Details

#full_versionObject



13
14
15
16
17
18
# File 'lib/browser/safari.rb', line 13

def full_version
  ua[%r[Version/([\d.]+)], 1] ||
    ua[%r[Safari/([\d.]+)], 1] ||
    ua[%r[AppleWebKit/([\d.]+)], 1] ||
    "0.0"
end

#idObject



5
6
7
# File 'lib/browser/safari.rb', line 5

def id
  :safari
end

#match?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/browser/safari.rb', line 20

def match?
  ua =~ /Safari/ && ua !~ /Chrome|CriOS|PhantomJS|FxiOS/
end

#nameObject



9
10
11
# File 'lib/browser/safari.rb', line 9

def name
  "Safari"
end