Module: UserAgent::Browsers::InternetExplorer

Defined in:
lib/user_agent/browsers/internet_explorer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extend?(agent) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
# File 'lib/user_agent/browsers/internet_explorer.rb', line 4

def self.extend?(agent)
  agent.application &&
    agent.application.comment &&
    agent.application.comment[0] == "compatible" &&
    agent.application.comment[1].match(/^MSIE/)
end

Instance Method Details

#browserObject



11
12
13
# File 'lib/user_agent/browsers/internet_explorer.rb', line 11

def browser
  "Internet Explorer"
end

#compatibilityObject



23
24
25
# File 'lib/user_agent/browsers/internet_explorer.rb', line 23

def compatibility
  application.comment[0]
end

#compatible?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/user_agent/browsers/internet_explorer.rb', line 27

def compatible?
  compatibility == "compatible"
end

#osObject



35
36
37
# File 'lib/user_agent/browsers/internet_explorer.rb', line 35

def os
  OperatingSystems.normalize_os(application.comment[2])
end

#platformObject



31
32
33
# File 'lib/user_agent/browsers/internet_explorer.rb', line 31

def platform
  "Windows"
end

#versionObject



19
20
21
# File 'lib/user_agent/browsers/internet_explorer.rb', line 19

def version
  application.comment[1].sub("MSIE ", "")
end

#version=(v) ⇒ Object



15
16
17
# File 'lib/user_agent/browsers/internet_explorer.rb', line 15

def version=(v)
  application.comment[1] = "MSIE #{v}"
end