Class: Serega::SeregaValidations::Attribute::CheckName
- Inherits:
-
Object
- Object
- Serega::SeregaValidations::Attribute::CheckName
- Defined in:
- lib/serega/validations/attribute/check_name.rb
Overview
Attribute ‘name` parameter validator
Constant Summary collapse
- FORMAT =
Regexp for valid attribute name
/\A[\w~-]+\z/
Class Method Summary collapse
-
.call(name) ⇒ void
Checks allowed characters.
Class Method Details
.call(name) ⇒ void
This method returns an undefined value.
Checks allowed characters. Allowed characters: “a-z”, “A-Z”, “0-9”, “_”, “-”, “~”.
23 24 25 26 |
# File 'lib/serega/validations/attribute/check_name.rb', line 23 def call(name) name = SeregaUtils::SymbolName.call(name) raise SeregaError, (name) unless FORMAT.match?(name) end |