class Dbsketch::Model::Column

Attributes

default[RW]
identity[R]
type[R]

Public Class Methods

new(name, type, meaning: nil, comment: nil, nullable: true, order: nil, identity: false, default: nil) click to toggle source
Calls superclass method Dbsketch::Model::AbstractColumn::new
# File lib/dbsketch/model/column.rb, line 12
def initialize name, type, meaning: nil, comment: nil, nullable: true, order: nil, identity: false, default: nil
        super(name, :meaning => meaning, :comment => comment, :nullable => nullable, :order => order)
        ### Preconditions
        raise ArgumentError, "type is not a Dbsketch::Model::Type" unless type.is_a? Dbsketch::Model::Type
        raise ArgumentError, "identity is not a boolean" unless identity.is_a? TrueClass or identity.is_a? FalseClass
        ###
        @type = type
        @identity = identity
        @default = default
end

Public Instance Methods

compatible_with?(other_column) click to toggle source
# File lib/dbsketch/model/column.rb, line 26
def compatible_with? other_column
        ### Preconditions
        raise ArgumentError, "other_column is not a Dbsketch::Model::Column" unless other_column.is_a? Column
        ###
        (@type.compatible_with? other_column.type) and (not @nullable or other_column.nullable)
end