Sha256: e9bb9c31ccc405038352af28c8b79f9c1e1c5bee474e54073d1e4aa0de1ebcd9

Contents?: true

Size: 353 Bytes

Versions: 15

Compression:

Stored size: 353 Bytes

Contents

module Csv2hash
  module StructureValidator
    class MinColumns

      include Validator

      def initialize min_size
        @min_size = min_size
      end

      def validate_line line
        line.size < @min_size
      end

      def error_message line
        "Not enough columns (min. #{@min_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/min_columns.rb
csv2hash-0.7.6 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.7.5 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.7.3 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.7.2 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.7.1 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.7.0 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.8 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.7 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.6 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.5 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.4 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.3 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.2 lib/csv2hash/structure_validator/min_columns.rb
csv2hash-0.6.1 lib/csv2hash/structure_validator/min_columns.rb