Class: OSU::Emplid

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

Overview

Validates an osu emplid.

Constant Summary collapse

VALID_EMPLID =

a valid emplid is an 8-9 digit string

/\A\d{8,9}\z/

Class Method Summary collapse

Class Method Details

.valid?(emplid) ⇒ Boolean

Returns true if the emplid is valid.

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/osu/emplid.rb', line 8

def self.valid?(emplid)
  case emplid
  when VALID_EMPLID then true
  else false
  end
end