Class: Rooq::Generator::TableInfo

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/rooq/generator/introspector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, columns:, primary_keys:, foreign_keys:) ⇒ void

Parameters:



256
257
258
259
260
261
262
# File 'lib/rooq/generator/introspector.rb', line 256

def initialize(name:, columns:, primary_keys:, foreign_keys:)
  @name = name
  @columns = T.let(columns.freeze, T::Array[ColumnInfo])
  @primary_keys = T.let(primary_keys.freeze, T::Array[String])
  @foreign_keys = T.let(foreign_keys.freeze, T::Array[ForeignKeyInfo])
  freeze
end

Instance Attribute Details

#columnsArray<ColumnInfo> (readonly)

Returns:



240
241
242
# File 'lib/rooq/generator/introspector.rb', line 240

def columns
  @columns
end

#foreign_keysArray<ForeignKeyInfo> (readonly)

Returns:



246
247
248
# File 'lib/rooq/generator/introspector.rb', line 246

def foreign_keys
  @foreign_keys
end

#nameString (readonly)

Returns:

  • (String)


237
238
239
# File 'lib/rooq/generator/introspector.rb', line 237

def name
  @name
end

#primary_keysArray<String> (readonly)

Returns:

  • (Array<String>)


243
244
245
# File 'lib/rooq/generator/introspector.rb', line 243

def primary_keys
  @primary_keys
end