Sha256: 7e7c414dbb9b72377f0a30a51e03b0509f476e44b491e9b0eb706d0e12b92c94

Contents?: true

Size: 583 Bytes

Versions: 1

Compression:

Stored size: 583 Bytes

Contents

require 'csv_row_model/internal/concerns/column_shared'

module CsvRowModel
  module DynamicColumnShared
    include ColumnShared
    #
    # row_model_class
    #
    def column_index
      @dynamic_column_index ||= row_model_class.dynamic_column_index(column_name)
    end

    def options
      row_model_class.dynamic_columns[column_name]
    end

    #
    # header models
    #
    def header_models
      Array(context.public_send(header_models_context_key))
    end

    def header_models_context_key
      options[:header_models_context_key] || column_name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csv_row_model-1.0.0.beta2 lib/csv_row_model/internal/concerns/dynamic_column_shared.rb