Class: DatatypeMappingEmailAddress
- Inherits:
-
DatatypeMappingText
- Object
- DatatypeMapping
- DatatypeMappingText
- DatatypeMappingEmailAddress
- Includes:
- Singleton
- Defined in:
- lib/ontomde-uml2/UMLdatatypeMapping.rb,
lib/ontomde-uml2/kb/datatypeMapping.rb
Constant Summary collapse
- MATCHING_UML_NAME =
["emailaddress","emailadress"]
Instance Attribute Summary
Attributes inherited from DatatypeMapping
Instance Method Summary collapse
- #appliesTo?(datatype) ⇒ Boolean
- #getHelp ⇒ Object
-
#getValidationRegexp ⇒ Object
EMAIL address regexp cf : www.regular-expressions.info/email.html.
Methods inherited from DatatypeMappingText
#initialize, #prot_getProtegeType
Methods inherited from DatatypeMapping
#getMapping, #getMappings, #initialize, #prot_getProtegeType, #register
Constructor Details
This class inherits a constructor from DatatypeMappingText
Instance Method Details
#appliesTo?(datatype) ⇒ Boolean
413 414 415 416 |
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 413 def appliesTo?(datatype) return true if MATCHING_UML_NAME.include?(datatype.uml_name_one.downcase) return false end |
#getHelp ⇒ Object
424 425 426 |
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 424 def getHelp return "any e-mail address" end |
#getValidationRegexp ⇒ Object
EMAIL address regexp cf : www.regular-expressions.info/email.html
420 421 422 |
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 420 def getValidationRegexp return /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/ end |