Class: AnnotateRb::ModelAnnotator::AnnotationDiff
- Inherits:
-
Object
- Object
- AnnotateRb::ModelAnnotator::AnnotationDiff
- Defined in:
- lib/annotate_rb/model_annotator/annotation_diff.rb
Overview
Plain old Ruby object for holding the differences
Instance Attribute Summary collapse
-
#current_columns ⇒ Object
readonly
Returns the value of attribute current_columns.
-
#new_columns ⇒ Object
readonly
Returns the value of attribute new_columns.
Instance Method Summary collapse
- #changed? ⇒ Boolean
-
#initialize(current_columns, new_columns) ⇒ AnnotationDiff
constructor
A new instance of AnnotationDiff.
Constructor Details
#initialize(current_columns, new_columns) ⇒ AnnotationDiff
Returns a new instance of AnnotationDiff.
9 10 11 12 |
# File 'lib/annotate_rb/model_annotator/annotation_diff.rb', line 9 def initialize(current_columns, new_columns) @current_columns = current_columns.dup.freeze @new_columns = new_columns.dup.freeze end |
Instance Attribute Details
#current_columns ⇒ Object (readonly)
Returns the value of attribute current_columns.
7 8 9 |
# File 'lib/annotate_rb/model_annotator/annotation_diff.rb', line 7 def current_columns @current_columns end |
#new_columns ⇒ Object (readonly)
Returns the value of attribute new_columns.
7 8 9 |
# File 'lib/annotate_rb/model_annotator/annotation_diff.rb', line 7 def new_columns @new_columns end |
Instance Method Details
#changed? ⇒ Boolean
14 15 16 |
# File 'lib/annotate_rb/model_annotator/annotation_diff.rb', line 14 def changed? @changed ||= @current_columns != @new_columns end |