Class: UserAgentParser::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/hacks/user_agent_parser.rb

Defined Under Namespace

Classes: Patterns

Constant Summary collapse

@@patterns =

rubocop:disable Style/ClassVars

Patterns.new

Class Method Summary collapse

Instance Method Summary collapse

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(options = {})
  @patterns_path = options[: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