Class: AnnotateRb::ModelAnnotator::AnnotationDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/annotate_rb/model_annotator/annotation_diff.rb

Overview

Plain old Ruby object for holding the differences

Instance Attribute Summary collapse

Instance Method Summary collapse

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_columnsObject (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_columnsObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/annotate_rb/model_annotator/annotation_diff.rb', line 14

def changed?
  @changed ||= @current_columns != @new_columns
end