Sha256: 1cffb0c56f8c85e2bf8ab137f839830a115a580669b4fbb907ce58f8e810e598

Contents?: true

Size: 404 Bytes

Versions: 7

Compression:

Stored size: 404 Bytes

Contents

module Aua::OperatingSystems::IOS
  PLATFORMS = %w(iPhone iPad iPod)
  PATTERN = /CPU( iPhone)?( OS )?([\d\._]+)? like Mac OS X/
  
  def self.extend?(agent)
    PLATFORMS.include?(agent.platform_string) && agent.os_string =~ PATTERN
  end
  
  def platform
    platform_string.to_sym
  end
  
  def os_name
    :iOS
  end
  
  def os_version
    os_string =~ PATTERN && $3 && $3.gsub(/_/, ".")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aua-0.2.2 lib/aua/operating_systems/ios.rb
aua-0.2.1 lib/aua/operating_systems/ios.rb
aua-0.2.0 lib/aua/operating_systems/ios.rb
aua-0.1.3 lib/aua/operating_systems/ios.rb
aua-0.1.2 lib/aua/operating_systems/ios.rb
aua-0.1.1 lib/aua/operating_systems/ios.rb
aua-0.1.0 lib/aua/operating_systems/ios.rb