Sha256: 1e11ea78097b3d00854869490c8b1d44c53000f904821fc37025cd526df56e32
Contents?: true
Size: 785 Bytes
Versions: 4
Compression:
Stored size: 785 Bytes
Contents
# frozen_string_literal: true module Phlexi module Table module Components module Concerns module GroupsColumns extend ActiveSupport::Concern included do attr_reader :columns end def initialize(*, **, &) super(*, **) @columns = {} yield self if block_given? end def column(key, **, &) add_column(parent.column_class.new(key, self, **, &)) end private def add_column(column) raise ArgumentError, "Column '#{column.key}' already exists" if @columns.key?(column.key) || parent.columns.key?(column.key) @columns[column.key] = column end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems