Sha256: 0c2d9df531df50b14eb6e9373331bec4e2883ede416d2761b2363684f3cb5120

Contents?: true

Size: 342 Bytes

Versions: 6

Compression:

Stored size: 342 Bytes

Contents

module Csv2hash::StructureValidator
  class MaxColumns

    include Csv2hash::StructureValidator::Validator

    def initialize max_size
      @max_size = max_size
    end

    def validate_line line
      line.size > @max_size
    end

    def error_message line
      "Too many columns (max. #{@max_size}) on line #{line}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
csv2hash-0.6.0 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.5.0 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.4.0 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.3.0 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.2.1 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.2.0 lib/csv2hash/structure_validator/max_columns.rb