Sha256: 1a2e857eb2ca569dac7ecd011d581730d496caa1932731d0c031cf03c8246a02

Contents?: true

Size: 543 Bytes

Versions: 5

Compression:

Stored size: 543 Bytes

Contents

module EasyTable
  module Components
    module Columns
      def column(title, label_or_opts = nil, opts = {}, &block)
        if label_or_opts.is_a?(Hash) && label_or_opts.extractable_options?
          label, opts = nil, label_or_opts
        else
          label, opts = label_or_opts, opts
        end
        child = node << Tree::TreeNode.new(title)
        column = Column.new(child, title, label, opts, @template, block)
        child.content = column
      end

      private

      def node
        @node
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
easy_table-0.0.8 lib/easy_table/components/columns.rb
easy_table-0.0.7 lib/easy_table/components/columns.rb
easy_table-0.0.6 lib/easy_table/components/columns.rb
easy_table-0.0.5 lib/easy_table/components/columns.rb
easy_table-0.0.4 lib/easy_table/components/columns.rb