Class: ZionData::Parser::Sentinels
- Inherits:
-
Object
- Object
- ZionData::Parser::Sentinels
- Includes:
- Helpers
- Defined in:
- lib/zion_data/parser/sentinels.rb
Overview
Class for parsing Zion sentinels data
Constant Summary collapse
- ROUTE_GROUP_SIZE =
2
Constants included from Helpers
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
Instance Method Summary collapse
-
#initialize(routes:) ⇒ Sentinels
constructor
A new instance of Sentinels.
- #parse ⇒ Object
Constructor Details
#initialize(routes:) ⇒ Sentinels
Returns a new instance of Sentinels.
11 12 13 |
# File 'lib/zion_data/parser/sentinels.rb', line 11 def initialize(routes:) @routes = parse_csv(routes) end |
Instance Attribute Details
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
9 10 11 |
# File 'lib/zion_data/parser/sentinels.rb', line 9 def routes @routes end |
Instance Method Details
#parse ⇒ Object
15 16 17 18 19 |
# File 'lib/zion_data/parser/sentinels.rb', line 15 def parse route_groups.map do |first, last| payload(first['node'], last['node'], first['time'], last['time']) end end |