class Browser::Platform::IOS

Constants

MATCHER
VERSION_MATCHER

Public Instance Methods

device() click to toggle source
# File lib/browser/platform/ios.rb, line 38
def device
  ua[MATCHER, 1]
end
id() click to toggle source
# File lib/browser/platform/ios.rb, line 30
def id
  :ios
end
match?() click to toggle source
# File lib/browser/platform/ios.rb, line 34
def match?
  ua.match?(MATCHER)
end
name() click to toggle source
# File lib/browser/platform/ios.rb, line 26
def name
  "iOS (#{device})"
end
version() click to toggle source
# File lib/browser/platform/ios.rb, line 10
def version
  matches = VERSION_MATCHER.match(ua)

  return "0" unless matches

  versions = [matches[:major]]

  if matches[:patch]
    versions.push(matches[:minor], matches[:patch])
  else
    versions.push(matches[:minor]) unless matches[:minor] == "0"
  end

  versions.join(".")
end