Class: SqlTools::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/sql_tools/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSchema

Returns a new instance of Schema.



6
7
8
9
# File 'lib/sql_tools/schema.rb', line 6

def initialize
  @columns = []
  @constraints = []
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



4
5
6
# File 'lib/sql_tools/schema.rb', line 4

def columns
  @columns
end

#constraintsObject (readonly)

Returns the value of attribute constraints.



4
5
6
# File 'lib/sql_tools/schema.rb', line 4

def constraints
  @constraints
end

#create_tableObject

Returns the value of attribute create_table.



3
4
5
# File 'lib/sql_tools/schema.rb', line 3

def create_table
  @create_table
end

Instance Method Details

#indicesObject



11
# File 'lib/sql_tools/schema.rb', line 11

def indices = @constraints.select { |c| c.is_a?(Index) }