Class: Browser::Platform::IOS

Inherits:
Base
  • Object
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

#deviceObject



25
26
27
# File 'lib/browser/platform/ios.rb', line 25

def device
  ua[MATCHER, 1]
end

#idObject



17
18
19
# File 'lib/browser/platform/ios.rb', line 17

def id
  :ios
end

#match?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/browser/platform/ios.rb', line 21

def match?
  ua =~ MATCHER
end

#nameObject



13
14
15
# File 'lib/browser/platform/ios.rb', line 13

def name
  "iOS (#{device})"
end

#versionObject



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

def version
  ua[VERSION_MATCHER, 1] || "0"
end