Class: ArelConverter::Replacement
- Inherits:
-
Object
- Object
- ArelConverter::Replacement
- Includes:
- Comparable
- Defined in:
- lib/arel_converter/replacement.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#new_content ⇒ Object
Returns the value of attribute new_content.
-
#old_content ⇒ Object
Returns the value of attribute old_content.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(old_content = nil, new_content = nil) ⇒ Replacement
constructor
A new instance of Replacement.
- #valid? ⇒ Boolean
Constructor Details
#initialize(old_content = nil, new_content = nil) ⇒ Replacement
Returns a new instance of Replacement.
7 8 9 10 |
# File 'lib/arel_converter/replacement.rb', line 7 def initialize(old_content=nil, new_content=nil) @old_content = old_content @new_content = new_content end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
5 6 7 |
# File 'lib/arel_converter/replacement.rb', line 5 def error @error end |
#new_content ⇒ Object
Returns the value of attribute new_content.
5 6 7 |
# File 'lib/arel_converter/replacement.rb', line 5 def new_content @new_content end |
#old_content ⇒ Object
Returns the value of attribute old_content.
5 6 7 |
# File 'lib/arel_converter/replacement.rb', line 5 def old_content @old_content end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/arel_converter/replacement.rb', line 16 def <=>(other) [self.old_content, self.new_content] <=> [other.old_content, other.new_content] end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/arel_converter/replacement.rb', line 12 def valid? @error.nil? end |