Class: UserAgent::Browsers::Gecko
- Inherits:
-
Base
- Object
- Array
- Base
- UserAgent::Browsers::Gecko
show all
- Defined in:
- lib/user_agent/browsers/gecko.rb
Constant Summary
collapse
- GeckoBrowsers =
%w(
PaleMoon
Firefox
Camino
Iceweasel
Seamonkey
).freeze
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
|
# File 'lib/user_agent/browsers/gecko.rb', line 4
def self.extend?(agent)
agent.application && agent.application.product == "Mozilla"
end
|
Instance Method Details
#browser ⇒ Object
16
17
18
|
# File 'lib/user_agent/browsers/gecko.rb', line 16
def browser
GeckoBrowsers.detect { |browser| respond_to?(browser) } || super
end
|
#localization ⇒ Object
59
60
61
62
63
|
# File 'lib/user_agent/browsers/gecko.rb', line 59
def localization
if = application.
[3]
end
end
|
#os ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/user_agent/browsers/gecko.rb', line 41
def os
if = application.
i = if [1] == 'U'
2
elsif /^Windows / =~ [0] || /^Android/ =~ [0]
0
elsif [0] == 'Mobile'
nil
else
1
end
return nil if i.nil?
OperatingSystems.normalize_os([i])
end
end
|
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/user_agent/browsers/gecko.rb', line 25
def platform
if = application.
if [0] == 'compatible' || [0] == 'Mobile'
nil
elsif /^Windows / =~ [0]
'Windows'
else
[0]
end
end
end
|
#security ⇒ Object
37
38
39
|
# File 'lib/user_agent/browsers/gecko.rb', line 37
def security
Security[application.[1]] || :strong
end
|
#version ⇒ Object
20
21
22
23
|
# File 'lib/user_agent/browsers/gecko.rb', line 20
def version
v = send(browser).version
v.nil? ? super : v
end
|