class TableSaw::ForeignKey

Attributes

from_column[R]
from_table[R]
name[R]
to_column[R]
to_table[R]

Public Class Methods

new(from_table:, from_column:, to_table:, to_column:, name: nil) click to toggle source
# File lib/table_saw/foreign_key.rb, line 39
def initialize(from_table:, from_column:, to_table:, to_column:, name: nil)
  @name = name
  @from_table = from_table
  @from_column = from_column
  @to_table = to_table
  @to_column = to_column
end

Public Instance Methods

column() click to toggle source
# File lib/table_saw/foreign_key.rb, line 51
def column
  @column ||= Column.new(from_column)
end
eql?(other) click to toggle source
# File lib/table_saw/foreign_key.rb, line 55
def eql?(other)
  hash == other.hash
end
hash() click to toggle source
# File lib/table_saw/foreign_key.rb, line 59
def hash
  [from_table, from_column, to_table, to_column].hash
end
type_condition() click to toggle source
# File lib/table_saw/foreign_key.rb, line 47
def type_condition
  @type_condition ||= column.type_condition
end