Class: Errata::Erratum::Delete
- Inherits:
-
Errata::Erratum
- Object
- Errata::Erratum
- Errata::Erratum::Delete
- Defined in:
- lib/erratum/delete.rb
Instance Attribute Summary collapse
-
#backfill ⇒ Object
Returns the value of attribute backfill.
-
#matching_expression ⇒ Object
Returns the value of attribute matching_expression.
Attributes inherited from Errata::Erratum
Instance Method Summary collapse
- #correct!(row) ⇒ Object
-
#initialize(errata, options = {}) ⇒ Delete
constructor
A new instance of Delete.
- #inspect ⇒ Object
Methods inherited from Errata::Erratum
#conditions_match?, #expression_matches?, #matching_methods, #set_matching_expression, #targets?
Constructor Details
#initialize(errata, options = {}) ⇒ Delete
Returns a new instance of Delete.
6 7 8 9 10 11 |
# File 'lib/erratum/delete.rb', line 6 def initialize(errata, = {}) super set_matching_expression() # otherwise abbr(X) will kill the characters before and after the match @backfill = /\Aabbr\((.*)\)\z/.match([:x]) ? '\1\2' : '' end |
Instance Attribute Details
#backfill ⇒ Object
Returns the value of attribute backfill.
4 5 6 |
# File 'lib/erratum/delete.rb', line 4 def backfill @backfill end |
#matching_expression ⇒ Object
Returns the value of attribute matching_expression.
4 5 6 |
# File 'lib/erratum/delete.rb', line 4 def matching_expression @matching_expression end |
Instance Method Details
#correct!(row) ⇒ Object
17 18 19 20 21 |
# File 'lib/erratum/delete.rb', line 17 def correct!(row) super(row) do row[column].gsub!(matching_expression, backfill) end end |
#inspect ⇒ Object
13 14 15 |
# File 'lib/erratum/delete.rb', line 13 def inspect super + " matching_expression=#{matching_expression}>" end |