Module: Aua::Agents::Msie

Defined in:
lib/aua/agents/msie.rb

Constant Summary collapse

PATTERN =
/(MSIE |Trident\/)([\d.]+)/
TRIDENT_VERSION_MAP =
{
  "7.0" => "11.0"
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extend?(agent) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/aua/agents/msie.rb', line 3

def self.extend?(agent)
  agent.app_comments_string =~ PATTERN
end

Instance Method Details

#nameObject



16
17
18
# File 'lib/aua/agents/msie.rb', line 16

def name
  :MSIE
end

#typeObject



12
13
14
# File 'lib/aua/agents/msie.rb', line 12

def type
  :Browser
end

#versionObject



20
21
22
23
24
25
# File 'lib/aua/agents/msie.rb', line 20

def version
  @version ||= begin
    app_comments_string =~ PATTERN
    $1 == "Trident\/" ? TRIDENT_VERSION_MAP[$2] || $2 : $2
  end
end