Class: IEV::SupersessionParser
- Inherits:
-
Object
- Object
- IEV::SupersessionParser
- Includes:
- CLI::UI
- Defined in:
- lib/iev/supersession_parser.rb
Overview
Parses information from the spreadsheet’s REPLACES column.
Constant Summary collapse
- IEV_SUPERSESSION_RX =
Regular expression which describes IEV relation, for example
881-01-23:1983-01or845-03-55:1987. %r{ \A (?:IEV\s+)? # some are prefixed with IEV, it is unnecessary though (?<ref>\d{3}-\d{2}-\d{2}) \s* # some have whitespaces around the separator : # separator \s* # some have whitespaces around the separator (?<version>[-0-9]+) \Z }x.freeze
Instance Attribute Summary collapse
-
#raw_str ⇒ Object
readonly
Returns the value of attribute raw_str.
-
#src_str ⇒ Object
readonly
Returns the value of attribute src_str.
-
#supersessions ⇒ Object
readonly
Returns the value of attribute supersessions.
Instance Method Summary collapse
-
#initialize(source_str) ⇒ SupersessionParser
constructor
A new instance of SupersessionParser.
Methods included from CLI::UI
debug, info, progress, set_ui_tag, warn
Constructor Details
#initialize(source_str) ⇒ SupersessionParser
Returns a new instance of SupersessionParser.
32 33 34 35 36 |
# File 'lib/iev/supersession_parser.rb', line 32 def initialize(source_str) @raw_str = source_str.dup.freeze @src_str = raw_str.sanitize.freeze @supersessions = parse end |
Instance Attribute Details
#raw_str ⇒ Object (readonly)
Returns the value of attribute raw_str.
15 16 17 |
# File 'lib/iev/supersession_parser.rb', line 15 def raw_str @raw_str end |
#src_str ⇒ Object (readonly)
Returns the value of attribute src_str.
15 16 17 |
# File 'lib/iev/supersession_parser.rb', line 15 def src_str @src_str end |
#supersessions ⇒ Object (readonly)
Returns the value of attribute supersessions.
17 18 19 |
# File 'lib/iev/supersession_parser.rb', line 17 def supersessions @supersessions end |