Class: Bureaucrat::Validators::MinLengthValidator

Inherits:
BaseValidator
  • Object
show all
Defined in:
lib/bureaucrat/validators.rb

Instance Method Summary collapse

Methods inherited from BaseValidator

#call, #initialize

Constructor Details

This class inherits a constructor from Bureaucrat::Validators::BaseValidator

Instance Method Details

#clean(x) ⇒ Object



140
141
142
# File 'lib/bureaucrat/validators.rb', line 140

def clean(x)
  x.length
end

#codeObject



132
133
134
# File 'lib/bureaucrat/validators.rb', line 132

def code
  :min_length
end

#compare(a, b) ⇒ Object



136
137
138
# File 'lib/bureaucrat/validators.rb', line 136

def compare(a, b)
  a < b
end

#messageObject



128
129
130
# File 'lib/bureaucrat/validators.rb', line 128

def message
  'Ensure this value has at least %(limit_value)d characters (it has %(show_value)d).'
end