Class: Kotoshu::Readers::RepPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/kotoshu/readers/aff_data.rb

Overview

Replacement pattern for suggestions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, replacement) ⇒ RepPattern

Create a new replacement pattern.

Parameters:

  • pattern (String)

    The pattern string

  • replacement (String)

    The replacement string



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

#matcherRegexp

Compiled matcher for the pattern

Returns:

  • (Regexp)

    the current value of matcher



130
131
132
# File 'lib/kotoshu/readers/aff_data.rb', line 130

def matcher
  @matcher
end

#patternString

The pattern to match

Returns:

  • (String)

    the current value of pattern



130
131
132
# File 'lib/kotoshu/readers/aff_data.rb', line 130

def pattern
  @pattern
end

#replacementString

The replacement string

Returns:

  • (String)

    the current value of replacement



130
131
132
# File 'lib/kotoshu/readers/aff_data.rb', line 130

def replacement
  @replacement
end