Class: GroongaSchema::Diff
- Inherits:
-
Object
- Object
- GroongaSchema::Diff
- Defined in:
- lib/groonga-schema/diff.rb
Defined Under Namespace
Classes: GroongaCommandListConverter
Instance Attribute Summary collapse
-
#added_columns ⇒ Object
readonly
Returns the value of attribute added_columns.
-
#added_plugins ⇒ Object
readonly
Returns the value of attribute added_plugins.
-
#added_tables ⇒ Object
readonly
Returns the value of attribute added_tables.
-
#changed_columns ⇒ Object
readonly
Returns the value of attribute changed_columns.
-
#changed_tables ⇒ Object
readonly
Returns the value of attribute changed_tables.
-
#removed_columns ⇒ Object
readonly
Returns the value of attribute removed_columns.
-
#removed_plugins ⇒ Object
readonly
Returns the value of attribute removed_plugins.
-
#removed_tables ⇒ Object
readonly
Returns the value of attribute removed_tables.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize ⇒ Diff
constructor
A new instance of Diff.
- #same? ⇒ Boolean
- #to_groonga_command_list(options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Diff
Returns a new instance of Diff.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/groonga-schema/diff.rb', line 29 def initialize @removed_plugins = [] @added_plugins = [] @removed_tables = {} @added_tables = {} @changed_tables = {} @removed_columns = {} @added_columns = {} @changed_columns = {} end |
Instance Attribute Details
#added_columns ⇒ Object (readonly)
Returns the value of attribute added_columns.
27 28 29 |
# File 'lib/groonga-schema/diff.rb', line 27 def added_columns @added_columns end |
#added_plugins ⇒ Object (readonly)
Returns the value of attribute added_plugins.
20 21 22 |
# File 'lib/groonga-schema/diff.rb', line 20 def added_plugins @added_plugins end |
#added_tables ⇒ Object (readonly)
Returns the value of attribute added_tables.
23 24 25 |
# File 'lib/groonga-schema/diff.rb', line 23 def added_tables @added_tables end |
#changed_columns ⇒ Object (readonly)
Returns the value of attribute changed_columns.
28 29 30 |
# File 'lib/groonga-schema/diff.rb', line 28 def changed_columns @changed_columns end |
#changed_tables ⇒ Object (readonly)
Returns the value of attribute changed_tables.
24 25 26 |
# File 'lib/groonga-schema/diff.rb', line 24 def changed_tables @changed_tables end |
#removed_columns ⇒ Object (readonly)
Returns the value of attribute removed_columns.
26 27 28 |
# File 'lib/groonga-schema/diff.rb', line 26 def removed_columns @removed_columns end |
#removed_plugins ⇒ Object (readonly)
Returns the value of attribute removed_plugins.
19 20 21 |
# File 'lib/groonga-schema/diff.rb', line 19 def removed_plugins @removed_plugins end |
#removed_tables ⇒ Object (readonly)
Returns the value of attribute removed_tables.
22 23 24 |
# File 'lib/groonga-schema/diff.rb', line 22 def removed_tables @removed_tables end |
Instance Method Details
#==(other) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/groonga-schema/diff.rb', line 42 def ==(other) return false unless other.is_a?(self.class) @removed_plugins == other.removed_plugins and @added_plugins == other.added_plugins and @removed_tables == other.removed_tables and @added_tables == other.added_tables and @changed_tables == other.changed_tables and @removed_columns == other.removed_columns and @added_columns == other.added_columns and @changed_columns == other.changed_columns end |
#same? ⇒ Boolean
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/groonga-schema/diff.rb', line 55 def same? @removed_plugins.empty? and @added_plugins.empty? and @removed_tables.empty? and @added_tables.empty? and @changed_tables.empty? and @removed_columns.empty? and @added_columns.empty? and @changed_columns.empty? end |
#to_groonga_command_list(options = {}) ⇒ Object
66 67 68 69 |
# File 'lib/groonga-schema/diff.rb', line 66 def to_groonga_command_list(={}) converter = GroongaCommandListConverter.new(self, ) converter.convert end |