Sha256: 60499c7ff7f3da108787662f67b6b9b89bb7248e66ed15e8a83d7f29d171b10e

Contents?: true

Size: 731 Bytes

Versions: 7

Compression:

Stored size: 731 Bytes

Contents

module Aua::OperatingSystems::Mobiles
  def self.extend?(agent)
    agent.platform_string == "BlackBerry" ||
    agent.platform_string == "J2ME/MIDP" ||
    agent.app_comments_string =~ PATTERN_SYMBIAN
  end

  PATTERN_SYMBIAN = /Symb(ian)?\s?OS\/?([\d\.]+)?/

  def name
    @name ||= begin
      name = super
      return :OperaMobile if name == :Opera && platform == :SymbianOS
      name
    end
  end

  def platform
    @platform ||= begin
      return :SymbianOS if app_comments_string =~ PATTERN_SYMBIAN
      platform_string.to_sym
    end
  end

  def os_name
    @os_name ||= platform
  end

  def os_version
    @os_version ||= begin
      return $2 if app_comments_string =~ PATTERN_SYMBIAN
      nil
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aua-0.3.2 lib/aua/operating_systems/mobiles.rb
aua-0.3.1 lib/aua/operating_systems/mobiles.rb
aua-0.3.0 lib/aua/operating_systems/mobiles.rb
aua-0.2.6 lib/aua/operating_systems/mobiles.rb
aua-0.2.5 lib/aua/operating_systems/mobiles.rb
aua-0.2.4 lib/aua/operating_systems/mobiles.rb
aua-0.2.3 lib/aua/operating_systems/mobiles.rb