Class: Identified::HighGroupList

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

Overview

An in-memory representation of a textual high group list.

Constant Summary collapse

HIGH_GROUP_LIST_DATE_REGEX =
%r(HIGHEST GROUP ISSUED AS OF (?<date>\d{1,2}/\d{2}/\d{2}))

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ HighGroupList

Returns a new instance of HighGroupList.



8
9
10
11
12
13
# File 'lib/identified/ssn/high_group_list.rb', line 8

def initialize(filename)
  raw_data = File.read(filename)

  @date_effective = parse_date(raw_data)
  @high_groups = parse_high_groups(raw_data)
end

Instance Attribute Details

#date_effectiveObject (readonly)

Returns the value of attribute date_effective.



6
7
8
# File 'lib/identified/ssn/high_group_list.rb', line 6

def date_effective
  @date_effective
end

#high_groupsObject (readonly)

Returns the value of attribute high_groups.



6
7
8
# File 'lib/identified/ssn/high_group_list.rb', line 6

def high_groups
  @high_groups
end

Instance Method Details

#high_group(area) ⇒ Object



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

def high_group(area)
  high_groups[area] # Returns nil if area is not present!
end