Class: MapSource::Reader
- Inherits:
-
Object
- Object
- MapSource::Reader
- Defined in:
- lib/mapsource/reader.rb
Overview
Constant Summary collapse
- SUPPORTED_VERSIONS =
Public: Range of format versions supported.
(1..3)
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#waypoints ⇒ Object
readonly
Public: Read waypoints from file.
Instance Method Summary collapse
-
#initialize(gdb) ⇒ Reader
constructor
Public: Creates a Reader.
-
#tracks ⇒ Object
Public: Reads tracks from file.
Constructor Details
#initialize(gdb) ⇒ Reader
Public: Creates a Reader.
gdb - An IO object pointing to a GDB.
21 22 23 24 25 26 |
# File 'lib/mapsource/reader.rb', line 21 def initialize(gdb) @gdb = gdb @header = read_header @parsed = false end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
16 17 18 |
# File 'lib/mapsource/reader.rb', line 16 def header @header end |
#waypoints ⇒ Object (readonly)
Public: Read waypoints from file.
Returns an Array of waypoints.
31 32 33 |
# File 'lib/mapsource/reader.rb', line 31 def waypoints @waypoints end |
Instance Method Details
#tracks ⇒ Object
Public: Reads tracks from file.
Returns an Array of tracks.
39 40 41 42 |
# File 'lib/mapsource/reader.rb', line 39 def tracks read_data @tracks end |