Class: Csvbuilder::Model::DynamicColumnHeader

Inherits:
Header
  • Object
show all
Includes:
DynamicColumnShared
Defined in:
lib/csvbuilder/dynamic/columns/core/internal/model/dynamic_column_header.rb

Instance Method Summary collapse

Methods included from DynamicColumnShared

#column_index, #header_models, #header_models_context_key, #options

Instance Method Details

#format_header(header_model) ⇒ Object



19
20
21
# File 'lib/csvbuilder/dynamic/columns/core/internal/model/dynamic_column_header.rb', line 19

def format_header(header_model)
  row_model_class.format_dynamic_column_header(header_model, column_name, context)
end

#header_procObject



15
16
17
# File 'lib/csvbuilder/dynamic/columns/core/internal/model/dynamic_column_header.rb', line 15

def header_proc
  options[:header] || ->(header_model) { format_header(header_model) }
end

#valueObject



11
12
13
# File 'lib/csvbuilder/dynamic/columns/core/internal/model/dynamic_column_header.rb', line 11

def value
  header_models.map { |header_model| header_proc.call(header_model) }
end