Class: SeeYouCup::Parser
- Inherits:
-
Object
- Object
- SeeYouCup::Parser
- Defined in:
- lib/see_you_cup/parser.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(path) ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 11 |
# File 'lib/see_you_cup/parser.rb', line 7 def initialize(path) raise FileNotFound unless File.exist?(path) @buffer = StringIO.new(load_file(path), 'r') end |
Instance Method Details
#parse ⇒ Object
13 14 15 16 17 |
# File 'lib/see_you_cup/parser.rb', line 13 def parse res = [] res << read_waypoint(@buffer) until @buffer.eof? res end |