Class: Booth::Models::UserAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/booth/models/user_agent.rb

Instance Method Summary collapse

Constructor Details

#initialize(agent_string) ⇒ UserAgent

Returns a new instance of UserAgent.



6
7
8
# File 'lib/booth/models/user_agent.rb', line 6

def initialize(agent_string)
  @agent_string = agent_string
end

Instance Method Details

#browser_image_pathObject



16
17
18
# File 'lib/booth/models/user_agent.rb', line 16

def browser_image_path
  "booth/browsers/#{browser_id}.svg"
end

#platform_image_pathObject



20
21
22
# File 'lib/booth/models/user_agent.rb', line 20

def platform_image_path
  "booth/platforms/#{platform_id}.svg"
end

#platform_nameObject



12
13
14
# File 'lib/booth/models/user_agent.rb', line 12

def platform_name
  browser.platform.name
end