Class: UserAgent::Browsers::WechatBrowser
- Inherits:
-
Base
- Object
- Array
- Base
- UserAgent::Browsers::WechatBrowser
show all
- Defined in:
- lib/user_agent/browsers/wechat_browser.rb
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/wechat_browser.rb', line 4
def self.extend?(agent)
agent.detect { |useragent| useragent.product =~ /MicroMessenger/i }
end
|
Instance Method Details
#browser ⇒ Object
8
9
10
|
# File 'lib/user_agent/browsers/wechat_browser.rb', line 8
def browser
'Wechat Browser'
end
|
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/user_agent/browsers/wechat_browser.rb', line 17
def platform
return unless application
if application.[0] =~ /iPhone/
'iPhone'
elsif application..any? { |c| c =~ /Android/ }
'Android'
else
application.[0]
end
end
|
#version ⇒ Object
12
13
14
15
|
# File 'lib/user_agent/browsers/wechat_browser.rb', line 12
def version
micro_messenger = detect_product("MicroMessenger")
Version.new(micro_messenger.version)
end
|