Class: SeeYouCup::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/see_you_cup/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Parser

Returns a new instance of Parser.

Raises:



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

#parseObject



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