Module: UserAgent::Browsers::Gecko
- Defined in:
- lib/user_agent/browsers/gecko.rb
Constant Summary collapse
- GeckoBrowsers =
%w( Firefox Camino Iceweasel Seamonkey ).freeze
Class Method Summary collapse
Instance Method Summary collapse
- #browser ⇒ Object
- #localization ⇒ Object
- #os ⇒ Object
- #platform ⇒ Object
- #security ⇒ Object
- #version ⇒ Object
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
15 16 17 |
# File 'lib/user_agent/browsers/gecko.rb', line 15 def browser GeckoBrowsers.detect { |browser| respond_to?(browser) } || super end |
#localization ⇒ Object
53 54 55 56 57 |
# File 'lib/user_agent/browsers/gecko.rb', line 53 def localization if comment = application.comment comment[3] end end |
#os ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/user_agent/browsers/gecko.rb', line 37 def os if comment = application.comment i = if comment[1] == "U" 2 else if comment[1] == "WOW64" 0 else 1 end end OperatingSystems.normalize_os(comment[i]) end end |
#platform ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/user_agent/browsers/gecko.rb', line 23 def platform if comment = application.comment if comment[0] =~ /Windows/ "Windows" else comment[0] == 'compatible' ? nil : comment[0] end end end |
#security ⇒ Object
33 34 35 |
# File 'lib/user_agent/browsers/gecko.rb', line 33 def security Security[application.comment[1]] || :strong end |
#version ⇒ Object
19 20 21 |
# File 'lib/user_agent/browsers/gecko.rb', line 19 def version send(browser).version || super end |