Class: Amalgalite::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/amalgalite/index.rb

Overview

a class representing the meta information about an SQLite index

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, sql, table) ⇒ Index

Returns a new instance of Index.



29
30
31
32
33
34
35
36
# File 'lib/amalgalite/index.rb', line 29

def initialize( name, sql, table ) 
  @name             = name
  @sql              = sql
  @table            = table
  @columns          = []
  @sequence_number  = nil
  @unique           = nil
end

Instance Attribute Details

#columnsObject

the columns that make up this index, in index order



21
22
23
# File 'lib/amalgalite/index.rb', line 21

def columns
  @columns
end

#nameObject (readonly)

the name of the index



12
13
14
# File 'lib/amalgalite/index.rb', line 12

def name
  @name
end

#sequence_numberObject

sqlite sequence number of the index



24
25
26
# File 'lib/amalgalite/index.rb', line 24

def sequence_number
  @sequence_number
end

#sqlObject (readonly)

the sql statement that created the index



15
16
17
# File 'lib/amalgalite/index.rb', line 15

def sql
  @sql
end

#tableObject

the table the index is for



18
19
20
# File 'lib/amalgalite/index.rb', line 18

def table
  @table
end

#unique=(value) ⇒ Object (writeonly)

is the index unique



27
28
29
# File 'lib/amalgalite/index.rb', line 27

def unique=(value)
  @unique = value
end

Instance Method Details

#unique?Boolean

Returns:



38
39
40
# File 'lib/amalgalite/index.rb', line 38

def unique?
  return @unique
end