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

#bot, #bot?, #chrome?, #compatibility_view?, #core_media?, #edge?, #firefox?, #ie?, #initialize, #known?, #meta, #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, #yandex?

Constructor Details

This class inherits a constructor from Browser::Base

Instance Method Details

#deviceObject



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

def device
  ua[MATCHER, 1]
end

#idObject



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

def id
  :ios
end

#match?Boolean

Returns:

  • (Boolean)


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

def match?
  ua =~ MATCHER
end

#nameObject



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

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

#versionObject



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

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