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.



4
5
6
# File 'lib/booth/models/user_agent.rb', line 4

def initialize(agent_string)
  @agent_string = agent_string
end

Instance Method Details

#browser_image_pathObject



14
15
16
# File 'lib/booth/models/user_agent.rb', line 14

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

#platform_image_pathObject



18
19
20
# File 'lib/booth/models/user_agent.rb', line 18

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

#platform_nameObject



10
11
12
# File 'lib/booth/models/user_agent.rb', line 10

def platform_name
  browser.platform.name
end