Class: Parser::GpxString
- Defined in:
- lib/simple_trail/parser/gpx_string.rb
Instance Attribute Summary collapse
-
#parsed_file ⇒ Object
readonly
Returns the value of attribute parsed_file.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#points_of_interests ⇒ Object
readonly
Returns the value of attribute points_of_interests.
-
#simplified_points ⇒ Object
readonly
Returns the value of attribute simplified_points.
Instance Method Summary collapse
-
#initialize(file_content) ⇒ GpxString
constructor
A new instance of GpxString.
- #meta ⇒ Object
- #read ⇒ Object
Constructor Details
#initialize(file_content) ⇒ GpxString
Returns a new instance of GpxString.
6 7 8 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 6 def initialize(file_content) @file_content = file_content end |
Instance Attribute Details
#parsed_file ⇒ Object (readonly)
Returns the value of attribute parsed_file.
4 5 6 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 4 def parsed_file @parsed_file end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
4 5 6 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 4 def points @points end |
#points_of_interests ⇒ Object (readonly)
Returns the value of attribute points_of_interests.
4 5 6 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 4 def points_of_interests @points_of_interests end |
#simplified_points ⇒ Object (readonly)
Returns the value of attribute simplified_points.
4 5 6 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 4 def simplified_points @simplified_points end |
Instance Method Details
#meta ⇒ Object
17 18 19 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 17 def @meta ||= extract_data end |
#read ⇒ Object
10 11 12 13 14 15 |
# File 'lib/simple_trail/parser/gpx_string.rb', line 10 def read @parsed_file = XmlHasher.parse(@file_content)[:gpx] fail unless @parsed_file extract_points extract_pois end |