Class: Browser::Platform::IOS
- Inherits:
-
Base
- Object
- Base
- Browser::Platform::IOS
show all
- Defined in:
- lib/browser/platform/ios.rb
Constant Summary
collapse
- MATCHER =
/(iPhone|iPad|iPod)/
- VERSION_MATCHER =
/OS ([\d.]+)/
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?, #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?, #webkit?, #webkit_full_version, #weibo?, #yandex?
Constructor Details
This class inherits a constructor from Browser::Base
Instance Method Details
#device ⇒ Object
25
26
27
|
# File 'lib/browser/platform/ios.rb', line 25
def device
ua[MATCHER, 1]
end
|
#id ⇒ Object
17
18
19
|
# File 'lib/browser/platform/ios.rb', line 17
def id
:ios
end
|
#match? ⇒ Boolean
21
22
23
|
# File 'lib/browser/platform/ios.rb', line 21
def match?
ua =~ MATCHER
end
|
#name ⇒ Object
13
14
15
|
# File 'lib/browser/platform/ios.rb', line 13
def name
"iOS (#{device})"
end
|
#version ⇒ Object
9
10
11
|
# File 'lib/browser/platform/ios.rb', line 9
def version
ua[VERSION_MATCHER, 1] || "0"
end
|