class InputSanitizer::CollectionLengthError

Public Class Methods

new(value, min, max) click to toggle source
Calls superclass method
# File lib/input_sanitizer/errors.rb, line 100
def initialize(value, min, max)
  if min && max
    super("must be of length between #{min} and #{max}, given: #{value}")
  elsif min
    super("must be of length greater than or equal to #{min}, given: #{value}")
  else
    super("must be of length less than or equal to #{max}, given: #{value}")
  end
end

Public Instance Methods

code() click to toggle source
# File lib/input_sanitizer/errors.rb, line 96
def code
  :invalid_length
end