Class: UserAgent::Browsers::Vivaldi
- Inherits:
-
Base
- Object
- Array
- Base
- UserAgent::Browsers::Vivaldi
show all
- Defined in:
- lib/user_agent/browsers/vivaldi.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#<=>, #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/vivaldi.rb', line 4
def self.extend?(agent)
agent.detect { |useragent| useragent.product == 'Vivaldi' }
end
|
Instance Method Details
#application ⇒ Object
20
21
22
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 20
def application
self.reject { |agent| agent..nil? || agent..empty? }.first
end
|
#browser ⇒ Object
8
9
10
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 8
def browser
'Vivaldi'
end
|
#build ⇒ Object
12
13
14
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 12
def build
webkit.version
end
|
#localization ⇒ Object
56
57
58
59
60
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 56
def localization
return unless application
application.[3]
end
|
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 24
def platform
return unless application
if application.[0] =~ /Windows/
'Windows'
elsif application..any? { |c| c =~ /CrOS/ }
'ChromeOS'
elsif application..any? { |c| c =~ /Android/ }
'Android'
else
application.[0]
end
end
|
#version ⇒ Object
16
17
18
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 16
def version
last.version
end
|
#webkit ⇒ Object
38
39
40
|
# File 'lib/user_agent/browsers/vivaldi.rb', line 38
def webkit
detect_product("AppleWebKit")
end
|