Sha256: 47141b202a62d95a74283d691c458e0cd87900bb348863173f75e689b947f5de

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

require 'bitmapped/exceptions'

module Bitmapped
  module Validators
    class ValidateColumnRowInput
      class << self
        def parse_and_validate(input)
          begin
            raise ArgumentError unless input.size == 2

            columns = Integer(input[0])
            rows = Integer(input[1])
            [columns, rows]
          rescue ArgumentError => ae
            raise ParsingError
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bitmapped-0.1.0 lib/bitmapped/validators/validate_column_row_input.rb