Class: Bitmapped::Validators::ValidateColumnRowInput

Inherits:
Object
  • Object
show all
Defined in:
lib/bitmapped/validators/validate_column_row_input.rb

Class Method Summary collapse

Class Method Details

.parse_and_validate(input) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bitmapped/validators/validate_column_row_input.rb', line 7

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