Class: AgentHelpers::Detector
- Inherits:
-
Object
- Object
- AgentHelpers::Detector
- Defined in:
- lib/agent_helpers/detector.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(args) ⇒ Detector
constructor
A new instance of Detector.
Constructor Details
#initialize(args) ⇒ Detector
Returns a new instance of Detector.
4 5 6 7 8 9 10 11 |
# File 'lib/agent_helpers/detector.rb', line 4 def initialize(args) @request = args[:request] raise "No request was given." unless @request @env = @request.env @user_agent = @request.user_agent.to_s.downcase.strip raise "No user agent was given." if @user_agent.empty? parse end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
2 3 4 |
# File 'lib/agent_helpers/detector.rb', line 2 def browser @browser end |
#device ⇒ Object (readonly)
Returns the value of attribute device.
2 3 4 |
# File 'lib/agent_helpers/detector.rb', line 2 def device @device end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
2 3 4 |
# File 'lib/agent_helpers/detector.rb', line 2 def title @title end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
2 3 4 |
# File 'lib/agent_helpers/detector.rb', line 2 def version @version end |