Module: Acb::Columns

Included in:
Base::ClassMethods
Defined in:
lib/acb/columns.rb

Instance Method Summary collapse

Instance Method Details

#add_column(column = nil, name: nil, **options) ⇒ Object



9
10
11
12
# File 'lib/acb/columns.rb', line 9

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

#columnsObject



5
6
7
# File 'lib/acb/columns.rb', line 5

def columns
  @_columns ||= []
end

#headerObject



14
15
16
# File 'lib/acb/columns.rb', line 14

def header
  columns.map(&:name)
end

#summarize(data) ⇒ Object



18
19
20
# File 'lib/acb/columns.rb', line 18

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