Module: CsvRowModel::DynamicColumnShared

Extended by:
ActiveSupport::Concern
Includes:
ColumnShared
Included in:
DynamicColumnAttributeBase, Model::DynamicColumnHeader
Defined in:
lib/csv_row_model/internal/concerns/dynamic_column_shared.rb

Instance Method Summary collapse

Methods included from ColumnShared

#context

Instance Method Details

#column_indexObject

row_model_class


11
12
13
# File 'lib/csv_row_model/internal/concerns/dynamic_column_shared.rb', line 11

def column_index
  @dynamic_column_index ||= row_model_class.dynamic_column_index(column_name)
end

#header_modelsObject

header models


22
23
24
# File 'lib/csv_row_model/internal/concerns/dynamic_column_shared.rb', line 22

def header_models
  Array(context.public_send(header_models_context_key))
end

#header_models_context_keyObject


26
27
28
# File 'lib/csv_row_model/internal/concerns/dynamic_column_shared.rb', line 26

def header_models_context_key
  options[:header_models_context_key] || column_name
end

#optionsObject


15
16
17
# File 'lib/csv_row_model/internal/concerns/dynamic_column_shared.rb', line 15

def options
  row_model_class.dynamic_columns[column_name]
end