Class: Rafflesia::TableColumn

Inherits:
Rafflesia::Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/annotations/table_column.rb

Constant Summary collapse

HASH_ATTRS =
{
  is_nullable: :is_nullable,
  name: :name,
  ordinal: :ordinal,
  type: :type
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ TableColumn

Returns a new instance of TableColumn.



21
22
23
24
25
26
27
28
# File 'lib/rafflesia/annotations/table_column.rb', line 21

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @is_nullable = hash[:is_nullable]
  @name = hash[:name]
  @ordinal = hash[:ordinal]
  @type = hash[:type]
end

Instance Attribute Details

#is_nullableObject

Returns the value of attribute is_nullable.



15
16
17
# File 'lib/rafflesia/annotations/table_column.rb', line 15

def is_nullable
  @is_nullable
end

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/rafflesia/annotations/table_column.rb', line 15

def name
  @name
end

#ordinalObject

Returns the value of attribute ordinal.



15
16
17
# File 'lib/rafflesia/annotations/table_column.rb', line 15

def ordinal
  @ordinal
end

#typeObject

Returns the value of attribute type.



15
16
17
# File 'lib/rafflesia/annotations/table_column.rb', line 15

def type
  @type
end