Module: Acb::Columns
- Included in:
- Base::ClassMethods
- Defined in:
- lib/acb/columns.rb
Instance Method Summary collapse
- #add_column(column = nil, name: nil, **options) ⇒ Object
- #columns ⇒ Object
- #header ⇒ Object
- #summarize(data) ⇒ Object
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, **) column ||= Column.new(name, **) columns.push(column) end |
#columns ⇒ Object
5 6 7 |
# File 'lib/acb/columns.rb', line 5 def columns @_columns ||= [] end |
#header ⇒ Object
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 |