Method: Udger::UaParser#initialize
- Defined in:
- lib/udger/ua_parser.rb
#initialize(db, ua_string, kargs = {}) ⇒ UaParser
Returns a new instance of UaParser.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/udger/ua_parser.rb', line 5 def initialize(db, ua_string, kargs = {}) super(db) @match_crawler = kargs.fetch(:crawler, true) @match_client = kargs.fetch(:client, true) @match_os = kargs.fetch(:os, true) @match_device = kargs.fetch(:device, true) @match_device_market = kargs.fetch(:device_market, true) @ua_string = ua_string @object = UserAgent.new @os_id = 0 @client_id = 0 @client_class_id = -1 @deviceclass_id = 0 end |