Class: RuboCop::Rails::SchemaLoader::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/rails/schema_loader/schema.rb

Overview

Represent an index

Direct Known Subclasses

AddIndex

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Index

Returns a new instance of Index.



144
145
146
147
148
149
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 144

def initialize(node)
  @columns, @expression = build_columns_or_expr(node.first_argument)
  @unique = nil

  analyze_keywords!(node)
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



142
143
144
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 142

def columns
  @columns
end

#expressionObject (readonly)

Returns the value of attribute expression.



142
143
144
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 142

def expression
  @expression
end

#nameObject (readonly)

Returns the value of attribute name.



142
143
144
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 142

def name
  @name
end

#uniqueObject (readonly)

Returns the value of attribute unique.



142
143
144
# File 'lib/rubocop/rails/schema_loader/schema.rb', line 142

def unique
  @unique
end