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.
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_path ⇒ Object
14 15 16 |
# File 'lib/booth/models/user_agent.rb', line 14 def browser_image_path "booth/browsers/#{browser_id}.svg" end |
#platform_image_path ⇒ Object
18 19 20 |
# File 'lib/booth/models/user_agent.rb', line 18 def platform_image_path "booth/platforms/#{platform_id}.svg" end |
#platform_name ⇒ Object
10 11 12 |
# File 'lib/booth/models/user_agent.rb', line 10 def platform_name browser.platform.name end |