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

Returns:

  • (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

#localizationObject



32
33
34
35
36
37
38
# File 'lib/user_agent/browsers/opera.rb', line 32

def localization
  if platform == "Macintosh"
    application.comment[3]
  else
    application.comment[2]
  end
end

#osObject



24
25
26
27
28
29
30
# File 'lib/user_agent/browsers/opera.rb', line 24

def os
  if application.comment[0] =~ /Windows/
    OperatingSystems.normalize_os(application.comment[0])
  else
    application.comment[1]
  end
end

#platformObject



8
9
10
11
12
13
14
# File 'lib/user_agent/browsers/opera.rb', line 8

def platform
  if application.comment[0] =~ /Windows/
    "Windows"
  else
    application.comment[0]
  end
end

#securityObject



16
17
18
19
20
21
22
# File 'lib/user_agent/browsers/opera.rb', line 16

def security
  if platform == "Macintosh"
    Security[application.comment[2]]
  else
    Security[application.comment[1]]
  end
end