Class: UserAgentParser::Parser
- Inherits:
-
Object
- Object
- UserAgentParser::Parser
- Defined in:
- lib/hacks/user_agent_parser.rb
Defined Under Namespace
Classes: Patterns
Constant Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(options = {}) ⇒ Parser
Returns a new instance of Parser.
43 44 45 46 |
# File 'lib/hacks/user_agent_parser.rb', line 43 def initialize( = {}) @patterns_path = [:patterns_path] @ua_patterns, @os_patterns, @device_patterns = Parser.load_patterns(@patterns_path) end |
Class Method Details
.load_patterns(path) ⇒ Object
39 40 41 |
# File 'lib/hacks/user_agent_parser.rb', line 39 def self.load_patterns(path) @@patterns.get(path) end |