class BitmapCmdEditor::Validators::ValidatorHelper

@author Diego HernĂ¡n Piccinini Lagos To validate a new bitmap image table created

Public Class Methods

less_than_min(obj,min,quantity) click to toggle source
# File lib/bitmap_cmd_editor/validators/validator_herlper.rb, line 16
def less_than_min(obj,min,quantity)
        raise LessColumnsThanAllowed.new(ErrorMessage.new(
                        :less_than_min,
                        {:obj=> obj , :min => min,:quantity => quantity }
                        ).show_content) if quantity < min
end
more_than_max(obj,max,quantity) click to toggle source
# File lib/bitmap_cmd_editor/validators/validator_herlper.rb, line 8
def more_than_max(obj,max,quantity)
        raise MoreColumnsThanAllowed.new(ErrorMessage.new(
                :more_than_max,
                {:obj=> obj , :max => max,:quantity => quantity }
                ).show_content) if quantity > max

end
out_of_range(obj,min,max,quantity) click to toggle source
# File lib/bitmap_cmd_editor/validators/validator_herlper.rb, line 23
def out_of_range(obj,min,max,quantity)
        raise OutOfRange.new(ErrorMessage.new(
                        :out_of_range,
                        {:obj=> obj , :min => min,:max => max,:quantity => quantity }
                        ).show_content) if quantity<min or quantity>max
end