class RareMap::Column
RareMap::Column
defines a column of a database table. @author Wei-Ming Wu @!attribute [r] name
@return [String] the name of this Column
@!attribute [r] type
@return [String] the type of this Column
@!attribute unique
@return [true, false] the uniqueness of this Column
@!attribute ref_table
@return [String] the reference table of this Column
Attributes
name[R]
ref_table[RW]
type[R]
unique[RW]
Public Class Methods
new(name, type, opts = {})
click to toggle source
Public Instance Methods
foreign_key?()
click to toggle source
Checks if this Column
is a foreign key.
@return [true, false] true if it’s a foreign key, false otherwise
# File lib/rare_map/column.rb, line 38 def foreign_key? @ref_table ? true : false end
unique?()
click to toggle source
Checks if this Column
is unique.
@return [true, false] true if it’s unique, false otherwise
# File lib/rare_map/column.rb, line 31 def unique? @unique end