Class: Errata::Erratum::Truncate
- Inherits:
-
Errata::Erratum
- Object
- Errata::Erratum
- Errata::Erratum::Truncate
- Defined in:
- lib/erratum/truncate.rb
Instance Attribute Summary collapse
-
#matching_expression ⇒ Object
Returns the value of attribute matching_expression.
-
#necessary_and_sufficient_prefix ⇒ Object
Returns the value of attribute necessary_and_sufficient_prefix.
Attributes inherited from Errata::Erratum
Instance Method Summary collapse
- #correct!(row) ⇒ Object
-
#initialize(errata, options = {}) ⇒ Truncate
constructor
A new instance of Truncate.
- #inspect ⇒ Object
Methods inherited from Errata::Erratum
#conditions_match?, #expression_matches?, #matching_methods, #set_matching_expression, #targets?
Constructor Details
#initialize(errata, options = {}) ⇒ Truncate
Returns a new instance of Truncate.
6 7 8 9 10 11 |
# File 'lib/erratum/truncate.rb', line 6 def initialize(errata, = {}) super @necessary_and_sufficient_prefix = [:x] raise "necessary_and_sufficient_prefix cannot be blank" if @necessary_and_sufficient_prefix.blank? set_matching_expression(.merge(:prefix => true)) end |
Instance Attribute Details
#matching_expression ⇒ Object
Returns the value of attribute matching_expression.
4 5 6 |
# File 'lib/erratum/truncate.rb', line 4 def matching_expression @matching_expression end |
#necessary_and_sufficient_prefix ⇒ Object
Returns the value of attribute necessary_and_sufficient_prefix.
4 5 6 |
# File 'lib/erratum/truncate.rb', line 4 def necessary_and_sufficient_prefix @necessary_and_sufficient_prefix end |
Instance Method Details
#correct!(row) ⇒ Object
17 18 19 20 21 |
# File 'lib/erratum/truncate.rb', line 17 def correct!(row) super(row) do row[column] = necessary_and_sufficient_prefix end end |
#inspect ⇒ Object
13 14 15 |
# File 'lib/erratum/truncate.rb', line 13 def inspect super + " matching_expression=#{matching_expression} necessary_and_sufficient_prefix=#{necessary_and_sufficient_prefix}>" end |