Class: MongoidTraffic::Logger::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid_traffic/logger/browser.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_agent_string) ⇒ Browser

Returns a new instance of Browser.



6
7
8
# File 'lib/mongoid_traffic/logger/browser.rb', line 6

def initialize(user_agent_string)
  @user_agent_string = user_agent_string
end

Instance Method Details

#nameObject



14
15
16
# File 'lib/mongoid_traffic/logger/browser.rb', line 14

def name
  user_agent.browser
end

#platformObject



10
11
12
# File 'lib/mongoid_traffic/logger/browser.rb', line 10

def platform
  user_agent.platform
end

#versionObject



18
19
20
# File 'lib/mongoid_traffic/logger/browser.rb', line 18

def version
  user_agent.version.to_s.split('.')[0..1].join('.')
end