Module: Icss::Validations
Instance Method Summary collapse
-
#validate_name ⇒ Object
An avro name must * start with [A-Za-z_] * subsequently contain only [A-Za-z0-9_].
- #validate_namespace ⇒ Object
Instance Method Details
#validate_name ⇒ Object
An avro name must
-
start with [A-Za-z_]
-
subsequently contain only [A-Za-z0-9_]
7 8 9 |
# File 'lib/icss/validations.rb', line 7 def validate_name (name =~ /\A[A-Za-z_]\w*\z/) or raise "An avro name must start with [A-Za-z_] and contain only [A-Za-z0-9_]; have #{name}. A namespace is the dot-separated sequence of such names." end |
#validate_namespace ⇒ Object
11 12 13 |
# File 'lib/icss/validations.rb', line 11 def validate_namespace (name =~ /\A([A-Za-z_]\w*\.?)+\z/) or raise "An avro name must start with [A-Za-z_] and contain only [A-Za-z0-9_]; have #{name}. A namespace is the dot-separated sequence of such names." end |