Class: Errata::Erratum::Delete
- Inherits:
-
Errata::Erratum
- Object
- Errata::Erratum
- Errata::Erratum::Delete
- Defined in:
- lib/errata/erratum/delete.rb
Constant Summary
Constants inherited from Errata::Erratum
REJECT_ACTIONS, SEMICOLON_DELIMITER, SPECIAL_ABBR
Instance Attribute Summary collapse
-
#backfill ⇒ Object
readonly
Returns the value of attribute backfill.
Attributes inherited from Errata::Erratum
#matching_expression, #matching_methods, #responder, #section
Instance Method Summary collapse
- #correct!(row) ⇒ Object
-
#initialize(responder, options = {}) ⇒ Delete
constructor
A new instance of Delete.
Methods inherited from Errata::Erratum
#abbr?, #conditions_match?, #expression_matches?, #targets?
Constructor Details
#initialize(responder, options = {}) ⇒ Delete
Returns a new instance of Delete.
6 7 8 9 10 11 12 13 14 |
# File 'lib/errata/erratum/delete.rb', line 6 def initialize(responder, = {}) super # otherwise abbr(X) will kill the characters before and after the match @backfill = if abbr? '\1\2' else '' end end |
Instance Attribute Details
#backfill ⇒ Object (readonly)
Returns the value of attribute backfill.
4 5 6 |
# File 'lib/errata/erratum/delete.rb', line 4 def backfill @backfill end |
Instance Method Details
#correct!(row) ⇒ Object
16 17 18 19 20 |
# File 'lib/errata/erratum/delete.rb', line 16 def correct!(row) if targets? row row[section].gsub! matching_expression, backfill end end |