Class: FuzzyMatch::Rule
- Inherits:
-
Object
- Object
- FuzzyMatch::Rule
- Defined in:
- lib/fuzzy_match/rule.rb,
lib/fuzzy_match/rule/grouping.rb,
lib/fuzzy_match/rule/identity.rb,
lib/fuzzy_match/rule/stop_word.rb,
lib/fuzzy_match/rule/normalizer.rb
Overview
A rule characterized by a regexp. Abstract.
Direct Known Subclasses
Defined Under Namespace
Classes: Grouping, Identity, Normalizer, StopWord
Instance Attribute Summary collapse
-
#regexp ⇒ Object
readonly
Returns the value of attribute regexp.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(regexp_or_str) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(regexp_or_str) ⇒ Rule
Returns a new instance of Rule.
6 7 8 |
# File 'lib/fuzzy_match/rule.rb', line 6 def initialize(regexp_or_str) @regexp = regexp_or_str.to_regexp end |
Instance Attribute Details
#regexp ⇒ Object (readonly)
Returns the value of attribute regexp.
4 5 6 |
# File 'lib/fuzzy_match/rule.rb', line 4 def regexp @regexp end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/fuzzy_match/rule.rb', line 10 def ==(other) regexp == other.regexp end |