Class: Identified::SequentialGroupNumber

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

Overview

An alternate version of the group number indexed by the allocation sequence. 1 indicates the 1st group number issued. 70 indicates the 70th group number issued, etc.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group_number) ⇒ SequentialGroupNumber

Takes a regular group number and becomes a representation sequenced by allocation order. Input values must be between 1 and 99. Output values will be between 1 and 100



7
8
9
10
# File 'lib/identified/ssn/sequential_group_number.rb', line 7

def initialize(group_number)
  sequential_group_number = self.class.convert_to_sequential_number(group_number)
  super(sequential_group_number)
end

Class Method Details

.convert_to_sequential_number(group_number) ⇒ Object

Converts a group number to the index of the sequence of its allocation. Valid return values are between 1 and 100.



14
15
16
17
# File 'lib/identified/ssn/sequential_group_number.rb', line 14

def self.convert_to_sequential_number(group_number)
  @group_index_table ||= generate_index_conversion
  @group_index_table.fetch(group_number)
end