Class: TableStructure::Schema::Table
- Inherits:
-
Object
- Object
- TableStructure::Schema::Table
- Defined in:
- lib/table_structure/schema/table.rb,
lib/table_structure/schema/table/key_decorator.rb
Defined Under Namespace
Classes: KeyDecorator
Constant Summary collapse
- DEFAULT_OPTIONS =
{ result_type: :array }.freeze
Instance Method Summary collapse
- #header(context: nil) ⇒ Object
-
#initialize(columns, context, options) ⇒ Table
constructor
A new instance of Table.
- #row(context: nil) ⇒ Object
Constructor Details
#initialize(columns, context, options) ⇒ Table
Returns a new instance of Table.
10 11 12 13 14 15 16 17 18 |
# File 'lib/table_structure/schema/table.rb', line 10 def initialize( columns, context, ) @columns = columns @context = context = DEFAULT_OPTIONS.merge() end |
Instance Method Details
#header(context: nil) ⇒ Object
20 21 22 |
# File 'lib/table_structure/schema/table.rb', line 20 def header(context: nil) values(:name, context) end |
#row(context: nil) ⇒ Object
24 25 26 |
# File 'lib/table_structure/schema/table.rb', line 24 def row(context: nil) values(:value, context) end |