Class: Kotoshu::Readers::RepPattern
- Inherits:
-
Object
- Object
- Kotoshu::Readers::RepPattern
- Defined in:
- lib/kotoshu/readers/aff_data.rb
Overview
Replacement pattern for suggestions.
Instance Attribute Summary collapse
-
#matcher ⇒ Regexp
Compiled matcher for the pattern.
-
#pattern ⇒ String
The pattern to match.
-
#replacement ⇒ String
The replacement string.
Instance Method Summary collapse
-
#initialize(pattern, replacement) ⇒ RepPattern
constructor
Create a new replacement pattern.
Constructor Details
#initialize(pattern, replacement) ⇒ RepPattern
Create a new replacement pattern.
137 138 139 140 141 |
# File 'lib/kotoshu/readers/aff_data.rb', line 137 def initialize(pattern, replacement) @pattern = pattern @replacement = replacement @matcher = Regexp.new(pattern) end |
Instance Attribute Details
#matcher ⇒ Regexp
Compiled matcher for the pattern
130 131 132 |
# File 'lib/kotoshu/readers/aff_data.rb', line 130 def matcher @matcher end |
#pattern ⇒ String
The pattern to match
130 131 132 |
# File 'lib/kotoshu/readers/aff_data.rb', line 130 def pattern @pattern end |
#replacement ⇒ String
The replacement string
130 131 132 |
# File 'lib/kotoshu/readers/aff_data.rb', line 130 def replacement @replacement end |