Method: Webhookdb::DBAdapter::Column#initialize

Defined in:
lib/webhookdb/db_adapter.rb

#initialize(**kwargs) ⇒ Column

Returns a new instance of Column.

Raises:

  • (ArgumentError)


47
48
49
50
51
52
53
54
55
56
# File 'lib/webhookdb/db_adapter.rb', line 47

def initialize(**kwargs)
  super
  self.typecheck!(:name, Symbol)
  self.typecheck!(:type, Symbol)
  self.typecheck!(:nullable, :boolean)
  self.typecheck!(:unique, :boolean)
  self.typecheck!(:index, :boolean)
  self.typecheck!(:pk, :boolean)
  raise ArgumentError, "type #{self.type.inspect} is not known" unless COLUMN_TYPES.include?(self.type)
end