Class: Bureaucrat::Validators::MaxLengthValidator

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

- (Object) clean(x)



168
169
170
# File 'lib/bureaucrat/validators.rb', line 168

def clean(x)
  x.length
end

- (Object) code



160
161
162
# File 'lib/bureaucrat/validators.rb', line 160

def code
  :max_length
end

- (Object) compare(a, b)



164
165
166
# File 'lib/bureaucrat/validators.rb', line 164

def compare(a, b)
  a > b
end

- (Object) message



156
157
158
# File 'lib/bureaucrat/validators.rb', line 156

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