Class: TableStructure::Schema::Definition::RowBuilder

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/table_structure/schema/definition/row_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(enabled_row_types: %i[array hash],, &block) ⇒ RowBuilder

Returns a new instance of RowBuilder.



11
12
13
14
15
16
17
# File 'lib/table_structure/schema/definition/row_builder.rb', line 11

def initialize(
  enabled_row_types: %i[array hash],
  &block
)
  @enabled_row_types = [enabled_row_types].flatten
  @callable = block
end

Instance Method Details

#enabled?(row_type) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/table_structure/schema/definition/row_builder.rb', line 19

def enabled?(row_type)
  @enabled_row_types.include?(row_type)
end