Class: Tabledata::TableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/tabledata/table_definition.rb

Overview

Table represents tabular data and provides various ways to create one, read from it and represent it in a different format.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier, table_name, columns) ⇒ TableDefinition


19
20
21
22
23
# File 'lib/tabledata/table_definition.rb', line 19

def initialize(identifier, table_name, columns)
  @identifier = identifier
  @table_name = table_name || identifier.to_s
  @columns    = columns
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns


17
18
19
# File 'lib/tabledata/table_definition.rb', line 17

def columns
  @columns
end

#identifierObject (readonly)

Returns the value of attribute identifier


15
16
17
# File 'lib/tabledata/table_definition.rb', line 15

def identifier
  @identifier
end

#table_nameObject (readonly)

Returns the value of attribute table_name


16
17
18
# File 'lib/tabledata/table_definition.rb', line 16

def table_name
  @table_name
end

Instance Method Details

#create_table_classObject


25
26
27
28
29
30
31
# File 'lib/tabledata/table_definition.rb', line 25

def create_table_class
  table_definition = self

  Class.new(Tabledata::CustomTable) do
    @definition = table_definition
  end
end