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(callable, enabled_row_types: %i[array hash]) ⇒ 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(
  callable,
  enabled_row_types: %i[array hash]
)
  @callable = callable
  @enabled_row_types = [enabled_row_types].flatten
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