Class: Ryodo::RuleSet
- Inherits:
-
Object
- Object
- Ryodo::RuleSet
- Defined in:
- lib/ryodo/rule_set.rb
Instance Method Summary collapse
-
#initialize ⇒ RuleSet
constructor
A new instance of RuleSet.
- #match(path) ⇒ Object
Constructor Details
#initialize ⇒ RuleSet
Returns a new instance of RuleSet.
3 4 5 6 |
# File 'lib/ryodo/rule_set.rb', line 3 def initialize @tree = {} build end |
Instance Method Details
#match(path) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/ryodo/rule_set.rb', line 8 def match(path) suffix, domain, match = find_match_parts(path, [], [], nil) suffix.push(domain.shift) if match && !match.exception # only if match has no children with domain and domain is present [suffix, [domain.shift], domain] if match && domain[0] && !match.children.keys.include?(domain[0]) end |