fluke/devops-service/db/validators/field_validators/image_name.rb
2016-01-12 12:01:07 +03:00

18 lines
369 B
Ruby

require_relative "base"
module Validators
module FieldValidator
class ImageName < Base
MAX_LEN = 100
def valid?
@value.length <= MAX_LEN
end
def message
"Invalid value '#{@value}': it should contains symbols 'a-zA-Z0-9_-.' and length should be more then 1 and less or equals then #{MAX_LEN}"
end
end
end
end