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.



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

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.



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

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.



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

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.



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

def name
  index.name
end