Class: Identified::HighGroupList
- Inherits:
-
Object
- Object
- Identified::HighGroupList
- 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
-
#date_effective ⇒ Object
readonly
Returns the value of attribute date_effective.
-
#high_groups ⇒ Object
readonly
Returns the value of attribute high_groups.
Instance Method Summary collapse
- #high_group(area) ⇒ Object
-
#initialize(filename) ⇒ HighGroupList
constructor
A new instance of HighGroupList.
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_effective ⇒ Object (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_groups ⇒ Object (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 |