Sha256: 9b1d02f685f0850c49a29e749fc7edaf0ecf2b0b8c2a3792ddd8a51fa3d8d2f0

Contents?: true

Size: 677 Bytes

Versions: 1

Compression:

Stored size: 677 Bytes

Contents

require_relative 'table'

module Intuition
  class Sheet
    attr_reader :title

    def initialize(title)
      @title = title
    end

    def header(*value)
      if value.any?
        @header = [value].flatten
      else
        @header
      end
    end

    def table(args = {}, &block)
      if block_given?
        @table = Table.new(args)
        yield @table
        @table.finalize
      else
        if args.is_a? Array
          @table = Table.new
          args.each {|r| @table.row(r) }
          @table.finalize
        end
      end
      @table
    end

    def full_table
      [header] + table.rows
    end

    def run_conversions(*args)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
intuition-0.0.1.alpha1 lib/intuition/sheet.rb