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)



158
159
160
# File 'lib/bureaucrat/validators.rb', line 158

def clean(x)
  x.length
end

- (Object) code



150
151
152
# File 'lib/bureaucrat/validators.rb', line 150

def code
  :max_length
end

- (Object) compare(a, b)



154
155
156
# File 'lib/bureaucrat/validators.rb', line 154

def compare(a, b)
  a > b
end

- (Object) message



146
147
148
# File 'lib/bureaucrat/validators.rb', line 146

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