Class: Atech::UserAgent
Instance Method Summary
collapse
Methods inherited from String
#first_character, generate_token, random, #to_md5, #to_sha1
Instance Method Details
#name ⇒ Object
39
40
41
|
# File 'lib/atech/user_agent.rb', line 39
def name
ActiveSupport::StringInquirer.new(name_and_version.first.to_s)
end
|
#os ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/atech/user_agent.rb', line 28
def os
ActiveSupport::StringInquirer.new(case self
when /(windows)|(win(\d{2}))/i then :windows
when /linux/i then :linux
when /macintosh/i then :mac
when /(iPhone)|(iPod)/ then :iphone
when /iPad/ then :ipad
else :unknown
end.to_s)
end
|
#version ⇒ Object
43
44
45
|
# File 'lib/atech/user_agent.rb', line 43
def version
name_and_version.last
end
|