class Mobi::Mtld::Da::Device::UaProps

Copyright
Author

This class tries to extract properties from the User-Agent string itself. This is a completely separate step to the main JSON tree walk but uses the results of the tree walk to optimise the property extraction. The property extraction is done in two steps.

Step 1: Try and identify the type of User-Agent and thus the set of property extraction rules to run. This is optimised by the properties from the tree walk.

Step 2: Run the rules found in step 1 to try and extract the properties.

Constants

KEY_DEFAULT_REGEX_SET
KEY_REFINE_REGEX_ID
KEY_REGEXES
KEY_REGEX_MATCH_POS
KEY_RULE_GROUPS
KEY_RULE_REGEX_ID
KEY_SEARCH_REGEX_ID
KEY_SKIP_IDS
KEY_UA_RULES

Constants to make keys more readable

Public Class Methods

new(tree_provider) click to toggle source

Public Instance Methods

put_properties(user_agent, props_to_vals, sought = nil) click to toggle source

Protected Instance Methods

init_get_matcher_propery_ids(group, prop_ids) click to toggle source

Find all the properties that are used for matching.

group

The rule group that can contain a property matcher

prop_ids

The list of found property IDs

init_rule_sets(group) click to toggle source

Prepare the rule set by extracting it from the current group and counting the items in the group. This is done to avoid counting the items on every request.

group

The current parent group.