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
#bot, #bot?, #chrome?, #compatibility_view?, #core_media?, #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
#device ⇒ Object
24
25
26
|
# File 'lib/browser/platform/ios.rb', line 24
def device
ua[MATCHER, 1]
end
|
#id ⇒ Object
16
17
18
|
# File 'lib/browser/platform/ios.rb', line 16
def id
:ios
end
|
#match? ⇒ Boolean
20
21
22
|
# File 'lib/browser/platform/ios.rb', line 20
def match?
ua =~ MATCHER
end
|
#name ⇒ Object
12
13
14
|
# File 'lib/browser/platform/ios.rb', line 12
def name
"iOS (#{device})"
end
|
#version ⇒ Object
8
9
10
|
# File 'lib/browser/platform/ios.rb', line 8
def version
ua[VERSION_MATCHER, 1] || "0"
end
|