Class: Parxer::Validator::Number

Inherits:
Base
  • Object
show all
Defined in:
lib/parxer/validators/number_validator.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#id, #initialize

Constructor Details

This class inherits a constructor from Parxer::Validator::Base

Instance Method Details

#validateObject



4
5
6
7
8
9
10
# File 'lib/parxer/validators/number_validator.rb', line 4

def validate
  v = context.value.to_s
  return true if v.blank?
  return false unless validate_number(v)
  return false unless validate_negative(v)
  validate_range(v)
end