Class: Rooq::Generator::ColumnInfo

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:, type:, pg_type:, nullable:, default:, max_length:, precision:, scale:) ⇒ void

Parameters:

  • name (String)
  • type (Symbol)
  • pg_type (String)
  • nullable (Boolean)
  • default (String, nil)
  • max_length (Integer, nil)
  • precision (Integer, nil)
  • scale (Integer, nil)


199
200
201
202
203
204
205
206
207
208
209
# File 'lib/rooq/generator/introspector.rb', line 199

def initialize(name:, type:, pg_type:, nullable:, default:, max_length:, precision:, scale:)
  @name = name
  @type = type
  @pg_type = pg_type
  @nullable = nullable
  @default = default
  @max_length = max_length
  @precision = precision
  @scale = scale
  freeze
end

Instance Attribute Details

#defaultString? (readonly)

Returns:

  • (String, nil)


176
177
178
# File 'lib/rooq/generator/introspector.rb', line 176

def default
  @default
end

#max_lengthInteger? (readonly)

Returns:

  • (Integer, nil)


179
180
181
# File 'lib/rooq/generator/introspector.rb', line 179

def max_length
  @max_length
end

#nameString (readonly)

Returns:

  • (String)


164
165
166
# File 'lib/rooq/generator/introspector.rb', line 164

def name
  @name
end

#nullableBoolean (readonly)

Returns:

  • (Boolean)


173
174
175
# File 'lib/rooq/generator/introspector.rb', line 173

def nullable
  @nullable
end

#pg_typeString (readonly)

Returns:

  • (String)


170
171
172
# File 'lib/rooq/generator/introspector.rb', line 170

def pg_type
  @pg_type
end

#precisionInteger? (readonly)

Returns:

  • (Integer, nil)


182
183
184
# File 'lib/rooq/generator/introspector.rb', line 182

def precision
  @precision
end

#scaleInteger? (readonly)

Returns:

  • (Integer, nil)


185
186
187
# File 'lib/rooq/generator/introspector.rb', line 185

def scale
  @scale
end

#typeSymbol (readonly)

Returns:

  • (Symbol)


167
168
169
# File 'lib/rooq/generator/introspector.rb', line 167

def type
  @type
end