Module: Stupidedi::TransactionSets::Builder::Dsl::TableSyntax
- Included in:
- DocumentBodyDSL
- Defined in:
- lib/stupidedi/transaction_sets/builder/dsl.rb
Overview
Syntax for DSLs in which you can define tables.
Instance Method Summary collapse
-
#get_table_contents(&block) ⇒ Object
Helper method to get the body of a table.
-
#table_detail(name, &block) ⇒ Object
Define a detail table within this block.
-
#table_header(name, &block) ⇒ Object
Define a header table within this block.
Instance Method Details
#get_table_contents(&block) ⇒ Object
Helper method to get the body of a table.
87 88 89 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 87 def get_table_contents(&block) TableBodyDSL.new(&block).elements end |
#table_detail(name, &block) ⇒ Object
Define a detail table within this block
81 82 83 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 81 def table_detail(name, &block) add_table(Schema::TableDef.detail(name, *get_table_contents(&block))) end |
#table_header(name, &block) ⇒ Object
Define a header table within this block.
75 76 77 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 75 def table_header(name, &block) add_table(Schema::TableDef.header(name, *get_table_contents(&block))) end |