Module: TableStructure::Schema
- Defined in:
- lib/table_structure/schema.rb,
lib/table_structure/schema/table.rb,
lib/table_structure/schema/utils.rb,
lib/table_structure/schema/column.rb,
lib/table_structure/schema/definition.rb,
lib/table_structure/schema/definition/error.rb,
lib/table_structure/schema/dsl/result_builder.rb,
lib/table_structure/schema/dsl/context_builder.rb,
lib/table_structure/schema/definition/validator.rb,
lib/table_structure/schema/dsl/column_converter.rb,
lib/table_structure/schema/dsl/column_definition.rb
Defined Under Namespace
Modules: DSL, Utils
Classes: Column, Definition, Table
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(klass) ⇒ Object
Instance Method Details
#column_converters ⇒ Object
37
38
39
|
# File 'lib/table_structure/schema.rb', line 37
def column_converters
@table_structure_schema_table_.column_converters
end
|
27
28
29
30
|
# File 'lib/table_structure/schema.rb', line 27
def (context: nil)
context = self.class.context_builders[:header].call(context)
@table_structure_schema_table_.(context)
end
|
#initialize(context: nil, **options) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/table_structure/schema.rb', line 12
def initialize(context: nil, **options)
column_definitions = self.class.column_definitions
column_converters = self.class.column_converters
result_builders = self.class.result_builders
context = self.class.context_builders[:table].call(context)
@table_structure_schema_table_ =
Table.new(
column_definitions,
column_converters,
result_builders,
context,
options
)
end
|
#row(context: nil) ⇒ Object
32
33
34
35
|
# File 'lib/table_structure/schema.rb', line 32
def row(context: nil)
context = self.class.context_builders[:row].call(context)
@table_structure_schema_table_.row(context)
end
|