Class: Browser::Platform::Mac
- Inherits:
-
Base
- Object
- Base
- Browser::Platform::Mac
show all
- Defined in:
- lib/browser/platform/mac.rb
Instance Attribute Summary
Attributes inherited from Base
#ua
Instance Method Summary
collapse
Methods inherited from Base
#accept_language, #alipay?, #bot, #bot?, #chrome?, #chromium_based?, #compatibility_view?, #core_media?, #device, #duck_duck_go?, #edge?, #electron?, #facebook?, #firefox?, #google_search_app?, #huawei_browser?, #ie?, #initialize, #instagram?, #known?, #maxthon?, #meta, #micro_messenger?, #miui_browser?, #msie_full_version, #msie_version, #nokia?, #opera?, #opera_mini?, #otter?, #phantom_js?, #platform, #proxy?, #qq?, #quicktime?, #safari?, #safari_webapp_mode?, #samsung_browser?, #snapchat?, #sougou_browser?, #sputnik?, #to_s, #uc_browser?, #unknown?, #webkit?, #webkit_full_version, #weibo?, #yandex?
Constructor Details
This class inherits a constructor from Browser::Base
Instance Method Details
#id ⇒ Object
16
17
18
|
# File 'lib/browser/platform/mac.rb', line 16
def id
:mac
end
|
#match? ⇒ Boolean
20
21
22
|
# File 'lib/browser/platform/mac.rb', line 20
def match?
ua.include?("Mac")
end
|
#name ⇒ Object
10
11
12
13
14
|
# File 'lib/browser/platform/mac.rb', line 10
def name
return "macOS" if platform.mac?(">= 10.12")
"Mac OS X"
end
|
#version ⇒ Object
6
7
8
|
# File 'lib/browser/platform/mac.rb', line 6
def version
(ua[/Mac OS X\s*([0-9_.]+)?/, 1] || "0").tr("_", ".")
end
|