Class: Bitmapped::Validators::ValidateBitmapSize

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

Class Method Summary collapse

Class Method Details

.parse_and_validate(input) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/bitmapped/validators/validated_bitmap_size.rb', line 8

def parse_and_validate(input)
  begin
    columns, rows = Validators::ValidateColumnRowInput.parse_and_validate(input)
    raise ArgumentError unless ((0 < columns && columns <= 250) && (0 < rows && rows <= 250))
  rescue ArgumentError => ae
    raise ParsingError
  end
end