Sha256: cf96581b78d33ba4038c8c03553f5daf7b37b368fe68cf8c3b175711af8c2539

Contents?: true

Size: 355 Bytes

Versions: 4

Compression:

Stored size: 355 Bytes

Contents

module DBF
  class ColumnLengthError < DBFError; end
  
  class Column
    attr_reader :name, :type, :length, :decimal

    def initialize(name, type, length, decimal)
      raise ColumnLengthError, "field length must be greater than 0" unless length > 0
      @name, @type, @length, @decimal = name.gsub(/\0/, ''), type, length, decimal
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dbf-1.0.1 lib/dbf/column.rb
dbf-1.0.0 lib/dbf/column.rb
dbf-1.0.2 lib/dbf/column.rb
dbf-1.0.3 lib/dbf/column.rb