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
#accept_language, #ua
Instance Method Summary
collapse
Methods inherited from Base
#bot, #bot?, #chrome?, #compatibility_view?, #core_media?, #device, #edge?, #firefox?, #ie?, #initialize, #known?, #meta, #micro_messenger?, #modern?, #msie_full_version, #msie_version, #nokia?, #opera?, #opera_mini?, #phantom_js?, #platform, #proxy?, #quicktime?, #safari?, #safari_webapp_mode?, #to_s, #uc_browser?, #webkit?, #webkit_full_version, #weibo?, #yandex?
Constructor Details
This class inherits a constructor from Browser::Base
Instance Method Details
#id ⇒ Object
13
14
15
|
# File 'lib/browser/platform/mac.rb', line 13
def id
:mac
end
|
#match? ⇒ Boolean
17
18
19
|
# File 'lib/browser/platform/mac.rb', line 17
def match?
ua =~ /Mac/
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/browser/platform/mac.rb', line 9
def name
"Macintosh"
end
|
#version ⇒ Object
5
6
7
|
# File 'lib/browser/platform/mac.rb', line 5
def version
(ua[/Mac OS X\s*([0-9_\.]+)?/, 1] || "0").gsub("_", ".")
end
|