Class: Schatz::Input::Parser
- Inherits:
-
Object
- Object
- Schatz::Input::Parser
- Defined in:
- lib/schatz/input/parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#connections ⇒ Object
Returns the value of attribute connections.
-
#links ⇒ Object
Returns the value of attribute links.
Instance Method Summary collapse
-
#initialize(lines) ⇒ Parser
constructor
A new instance of Parser.
- #parse(line) ⇒ Object
Constructor Details
#initialize(lines) ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 9 |
# File 'lib/schatz/input/parser.rb', line 5 def initialize(lines) @connections = [] @links = [] lines.map { |line| parse(line)} end |
Instance Attribute Details
#connections ⇒ Object
Returns the value of attribute connections.
4 5 6 |
# File 'lib/schatz/input/parser.rb', line 4 def connections @connections end |
#links ⇒ Object
Returns the value of attribute links.
4 5 6 |
# File 'lib/schatz/input/parser.rb', line 4 def links @links end |
Instance Method Details
#parse(line) ⇒ Object
11 12 13 |
# File 'lib/schatz/input/parser.rb', line 11 def parse(line) raise NotImplementedMethod end |