lib/errata/erratum/delete.rb in errata-1.0.3 vs lib/errata/erratum/delete.rb in errata-1.1.0
- old
+ new
@@ -1,10 +1,17 @@
class Errata
class Erratum
class Delete < Erratum
- def backfill
+ attr_reader :backfill
+
+ def initialize(responder, options = {})
+ super
# otherwise abbr(X) will kill the characters before and after the match
- @backfill ||= /\Aabbr\((.*)\)\z/.match(options['x']) ? '\1\2' : ''
+ @backfill = if abbr?
+ '\1\2'
+ else
+ ''
+ end
end
def correct!(row)
if targets? row
row[section].gsub! matching_expression, backfill