Sha256: 40dce6ba01fb4945eccb7b58ad8fecf9c12b32f8f489e9aaca9307118da2e3ca

Contents?: true

Size: 536 Bytes

Versions: 1

Compression:

Stored size: 536 Bytes

Contents

module CsvRowModel
  module Export
    class Cell
      attr_reader :column_name, :row_model

      def initialize(column_name, row_model)
        @column_name = column_name
        @row_model = row_model
      end

      def value
        formatted_value
      end

      def formatted_value
        @formatted_value ||= row_model.class.format_cell(source_value, column_name, row_model.class.index(column_name), row_model.context)
      end

      def source_value
        row_model.public_send(column_name)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csv_row_model-1.0.0.beta1 lib/csv_row_model/export/cell.rb