Class: Identified::AreaNumber

Inherits:
Fixnum
  • Object
show all
Defined in:
lib/identified/ssn/area_number.rb

Overview

Represents the area number of an SSN.

Instance Method Summary collapse

Instance Method Details

#valid?Boolean

Returns whether the ssn COULD be a valid ssn area code.

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
13
# File 'lib/identified/ssn/area_number.rb', line 5

def valid?
  # Currently only 000, 666 & 900+ are prohibited area numbers.
  # See http://www.ssa.gov/employer/randomization.html
  (1..665).include?(self) || (667..899).include?(self)

  # NOTE: Prior to randomization, there were more restricted ranges. This is no longer checked
  # inside of AreaNumber because it is redundant due to the pre-randomization group number check
  # also validating this same information (if the area is absent in the table, it is unissued).
end