Class: Sawtooth::Rules::RuleEntry
- Inherits:
-
Object
- Object
- Sawtooth::Rules::RuleEntry
- Defined in:
- lib/sawtooth/rules/set.rb
Overview
An entry in the ‘Set`.
Instance Attribute Summary collapse
-
#orig_path ⇒ Object
readonly
Returns the value of attribute orig_path.
-
#path ⇒ Object
Both path and the rule are accessible.
-
#rule ⇒ Object
Both path and the rule are accessible.
Instance Method Summary collapse
-
#initialize(path, rule) ⇒ RuleEntry
constructor
Creates a new entry using path and the rule instance.
-
#matches?(test) ⇒ Boolean
Returns ‘true` if the current path matches.
Constructor Details
#initialize(path, rule) ⇒ RuleEntry
Creates a new entry using path and the rule instance.
12 13 14 |
# File 'lib/sawtooth/rules/set.rb', line 12 def initialize(path, rule) self.path, self.rule = path, rule end |
Instance Attribute Details
#orig_path ⇒ Object (readonly)
Returns the value of attribute orig_path.
9 10 11 |
# File 'lib/sawtooth/rules/set.rb', line 9 def orig_path @orig_path end |
#path ⇒ Object
Both path and the rule are accessible.
8 9 10 |
# File 'lib/sawtooth/rules/set.rb', line 8 def path @path end |
#rule ⇒ Object
Both path and the rule are accessible.
8 9 10 |
# File 'lib/sawtooth/rules/set.rb', line 8 def rule @rule end |
Instance Method Details
#matches?(test) ⇒ Boolean
Returns ‘true` if the current path matches.
25 26 27 |
# File 'lib/sawtooth/rules/set.rb', line 25 def matches?(test) test =~ path end |