Sha256: 8573e66ce24e31a91809913d3b972f5d1046e416e7f4e816bb9e5a380c6984a8

Contents?: true

Size: 351 Bytes

Versions: 15

Compression:

Stored size: 351 Bytes

Contents

module Csv2hash
  module StructureValidator
    class MaxColumns

      include 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
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
csv2hash-0.7.7 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.7.6 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.7.5 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.7.3 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.7.2 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.7.1 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.7.0 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.8 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.7 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.6 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.5 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.4 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.3 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.2 lib/csv2hash/structure_validator/max_columns.rb
csv2hash-0.6.1 lib/csv2hash/structure_validator/max_columns.rb