Class: OSU::NameN

Inherits:
Object
  • Object
show all
Defined in:
lib/osu/name_n.rb

Overview

Validates a name.#

Constant Summary collapse

VALID_NAME_N =
/\A(?<name_n>[a-z]([a-z-]*[a-z])?\.[1-9]\d*)\z/i

Class Method Summary collapse

Class Method Details

.valid?(name_n) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
# File 'lib/osu/name_n.rb', line 6

def self.valid?(name_n)
  case name_n
  when VALID_NAME_N then true
  else false
  end
end