Class: UserAgent::Browsers::InternetExplorer
- Inherits:
-
Base
- Object
- Array
- Base
- UserAgent::Browsers::InternetExplorer
show all
- Defined in:
- lib/user_agent/browsers/internet_explorer.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#<=>, #application, #bot?, #eql?, #method_missing, #mobile?, #respond_to?, #to_h, #to_s, #to_str
Methods included from Comparable
#<, #<=, #==, #>, #>=
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class UserAgent::Browsers::Base
Class Method Details
.extend?(agent) ⇒ 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. &&
(agent.application.[1] =~ /MSIE/ ||
agent.application..join('; ') =~ /Trident.+rv:/)
end
|
Instance Method Details
#browser ⇒ Object
11
12
13
|
# File 'lib/user_agent/browsers/internet_explorer.rb', line 11
def browser
"Internet Explorer"
end
|
#chromeframe ⇒ Object
Before version 4.0, Chrome Frame declared itself (unversioned) in a comment; as of 4.0 it can declare itself versioned in a comment or as a separate product with a version
27
28
29
30
31
32
|
# File 'lib/user_agent/browsers/internet_explorer.rb', line 27
def chromeframe
cf = application..include?("chromeframe") || detect_product("chromeframe")
return cf if cf
= application..detect { |c| c['chromeframe/'] }
? UserAgent.new(*.split('/', 2)) : nil
end
|
#compatibility_view? ⇒ Boolean
20
21
22
|
# File 'lib/user_agent/browsers/internet_explorer.rb', line 20
def compatibility_view?
version == "7.0" && application..detect { |c| c['Trident/'] }
end
|
#os ⇒ Object
38
39
40
|
# File 'lib/user_agent/browsers/internet_explorer.rb', line 38
def os
OperatingSystems.normalize_os(application..join('; ').match(/Windows NT [\d\.]+|Windows Phone (OS )?[\d\.]+/).to_s)
end
|
34
35
36
|
# File 'lib/user_agent/browsers/internet_explorer.rb', line 34
def platform
"Windows"
end
|
#version ⇒ Object
15
16
17
18
|
# File 'lib/user_agent/browsers/internet_explorer.rb', line 15
def version
str = application..join('; ')[/(MSIE\s|rv:)([\d\.]+)/, 2]
Version.new(str)
end
|