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.



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

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.



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

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.



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

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.



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

def name
  index.name
end