Class: Booth::Models::UserAgent
- Inherits:
-
Object
- Object
- Booth::Models::UserAgent
- Defined in:
- lib/booth/models/user_agent.rb
Instance Method Summary collapse
- #browser_image_path ⇒ Object
-
#initialize(agent_string) ⇒ UserAgent
constructor
A new instance of UserAgent.
- #platform_image_path ⇒ Object
- #platform_name ⇒ Object
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_path ⇒ Object
16 17 18 |
# File 'lib/booth/models/user_agent.rb', line 16 def browser_image_path "booth/browsers/#{browser_id}.svg" end |
#platform_image_path ⇒ Object
20 21 22 |
# File 'lib/booth/models/user_agent.rb', line 20 def platform_image_path "booth/platforms/#{platform_id}.svg" end |
#platform_name ⇒ Object
12 13 14 |
# File 'lib/booth/models/user_agent.rb', line 12 def platform_name browser.platform.name end |