Module: Icss::Validations

Included in:
NamedType, Protocol
Defined in:
lib/icss/validations.rb

Instance Method Summary collapse

Instance Method Details

#validate_nameObject

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_namespaceObject



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