Sha256: 71b42ca07c7246772f088be0cac3bdf4875d711e0f5db89f774a7e06f80c42c0

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

# frozen_string_literal: true

module Acb
  module Columns
    def columns
      @_columns ||= []
    end

    def add_column(column = nil, name: nil, **options)
      column ||= Column.new(name, **options)
      columns.push(column)
    end

    def header
      columns.map(&:name)
    end

    def summarize(data)
      columns.map { |column| column.digest(data) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acb-0.2.1 lib/acb/columns.rb
acb-0.2.0 lib/acb/columns.rb