mimimi/ruby-tsv

View on GitHub
lib/tsv.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'forwardable'

require "tsv/version"
require "tsv/row"
require "tsv/table"

module TSV
  extend self

  def parse(content, opts = {}, &block)
    TSV::Table.new(content, opts, &block)
  end

  def parse_file(filename, opts = {}, &block)
    TSV::Table.new(File.new(filename, 'r'), opts, &block)
  end

  alias :[] :parse_file

  class ReadOnly < StandardError
  end
end