Class: Gort::RuleSet Abstract
- Inherits:
-
Object
- Object
- Gort::RuleSet
- Defined in:
- lib/gort/rule_set.rb
Overview
This class is abstract.
Abstract rule set.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#rules ⇒ Array<Group, UserAgentRule, AllowRule, DisallowRule, Rule, InvalidLine>
readonly
Rules in this set.
Instance Method Summary collapse
-
#initialize(*rules) ⇒ RuleSet
constructor
A new instance of RuleSet.
-
#merge(other) ⇒ RuleSet
Make a new set by mergin this one with another.
Constructor Details
#initialize(*rules) ⇒ RuleSet
Returns a new instance of RuleSet.
10 11 12 |
# File 'lib/gort/rule_set.rb', line 10 def initialize(*rules) @rules = rules.flatten.freeze end |
Instance Attribute Details
#rules ⇒ Array<Group, UserAgentRule, AllowRule, DisallowRule, Rule, InvalidLine> (readonly)
Rules in this set
16 17 18 |
# File 'lib/gort/rule_set.rb', line 16 def rules @rules end |
Instance Method Details
#merge(other) ⇒ RuleSet
Make a new set by mergin this one with another.
21 22 23 |
# File 'lib/gort/rule_set.rb', line 21 def merge(other) self.class.new(rules + other.rules) end |