Class: Dbsketch::Comparison::ColumnDiff
- Defined in:
- lib/dbsketch/comparison/column_comparator.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#identity ⇒ Object
readonly
Returns the value of attribute identity.
-
#nullable ⇒ Object
readonly
Returns the value of attribute nullable.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Diff
Instance Method Summary collapse
-
#initialize(old_column, new_column, type_comparator, options) ⇒ ColumnDiff
constructor
A new instance of ColumnDiff.
Methods inherited from Diff
#addition?, #change?, #deletion?
Constructor Details
#initialize(old_column, new_column, type_comparator, options) ⇒ ColumnDiff
Returns a new instance of ColumnDiff.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dbsketch/comparison/column_comparator.rb', line 13 def initialize old_column, new_column, type_comparator, super old_column, new_column if change? @type = type_comparator.compare(old_column.type, new_column.type) @identity = Diff.new(old_column.identity, new_column.identity) if old_column.identity != new_column.identity @default = Diff.new(old_column.default, new_column.default) if old_column.default != new_column.default @nullable = Diff.new(old_column.nullable, new_column.nullable) if old_column.nullable != new_column.nullable @order = Diff.new(old_column.order, new_column.order) if [:compare_order] and old_column.order != new_column.order end end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
24 25 26 |
# File 'lib/dbsketch/comparison/column_comparator.rb', line 24 def default @default end |
#identity ⇒ Object (readonly)
Returns the value of attribute identity.
24 25 26 |
# File 'lib/dbsketch/comparison/column_comparator.rb', line 24 def identity @identity end |
#nullable ⇒ Object (readonly)
Returns the value of attribute nullable.
24 25 26 |
# File 'lib/dbsketch/comparison/column_comparator.rb', line 24 def nullable @nullable end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
24 25 26 |
# File 'lib/dbsketch/comparison/column_comparator.rb', line 24 def order @order end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
24 25 26 |
# File 'lib/dbsketch/comparison/column_comparator.rb', line 24 def type @type end |