Class: ROM::SQL::Migration::SchemaDiff::IndexDiff Private

Inherits:
Object
  • Object
show all
Defined in:
lib/rom/sql/migration/schema_diff.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

IndexAdded, IndexRemoved

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ IndexDiff

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of IndexDiff.



115
116
117
# File 'lib/rom/sql/migration/schema_diff.rb', line 115

def initialize(index)
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



113
114
115
# File 'lib/rom/sql/migration/schema_diff.rb', line 113

def index
  @index
end

Instance Method Details

#attributesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



119
120
121
122
123
124
125
126
127
# File 'lib/rom/sql/migration/schema_diff.rb', line 119

def attributes
  list = index.attributes.map(&:name)

  if list.size == 1
    list[0]
  else
    list
  end
end

#nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



129
130
131
# File 'lib/rom/sql/migration/schema_diff.rb', line 129

def name
  index.name
end