Sha256: df7e2776f8801fca9d35a4bdb4d0d634699ad2796e373301cd1551b06d9d0579

Contents?: true

Size: 295 Bytes

Versions: 2

Compression:

Stored size: 295 Bytes

Contents

module Intuition
  class Table
    attr_reader :rows
    attr_reader :sorted

    def initialize(args = {})
      @rows = []
      @sorted = args.fetch(:sorted, false)
    end

    def row(*row)
      @rows << [row].flatten
    end

    def finalize
      rows.sort! if sorted
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
intuition-0.0.1.alpha2 lib/intuition/table.rb
intuition-0.0.1.alpha1 lib/intuition/table.rb