Module: UserAgent::Browsers::Opera
- Defined in:
- lib/user_agent/browsers/opera.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extend?(agent) ⇒ Boolean
4 5 6 |
# File 'lib/user_agent/browsers/opera.rb', line 4 def self.extend?(agent) agent.application && agent.application.product == "Opera" end |
Instance Method Details
#localization ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/user_agent/browsers/opera.rb', line 46 def localization if application.comment.nil? nil elsif platform == "Macintosh" application.comment[3] else application.comment[2] end end |
#os ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/user_agent/browsers/opera.rb', line 36 def os if application.comment.nil? nil elsif application.comment[0] =~ /Windows/ OperatingSystems.normalize_os(application.comment[0]) else application.comment[1] end end |
#platform ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/user_agent/browsers/opera.rb', line 16 def platform if application.comment.nil? nil elsif application.comment[0] =~ /Windows/ "Windows" else application.comment[0] end end |
#security ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/user_agent/browsers/opera.rb', line 26 def security if application.comment.nil? :strong elsif platform == "Macintosh" Security[application.comment[2]] else Security[application.comment[1]] end end |
#version ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/user_agent/browsers/opera.rb', line 8 def version if product = detect_product('Version') product.version else super end end |