Class: GpxDoctor::Models::Track

Inherits:
Struct
  • Object
show all
Defined in:
lib/gpx_doctor/models/track.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTrack

Returns a new instance of Track.



9
10
11
12
13
# File 'lib/gpx_doctor/models/track.rb', line 9

def initialize(**)
  super
  self.links    ||= []
  self.segments ||= []
end

Instance Attribute Details

#cmtObject

Returns the value of attribute cmt

Returns:

  • (Object)

    the current value of cmt



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def cmt
  @cmt
end

#descObject

Returns the value of attribute desc

Returns:

  • (Object)

    the current value of desc



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def desc
  @desc
end

Returns the value of attribute links

Returns:

  • (Object)

    the current value of links



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def links
  @links
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def name
  @name
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def number
  @number
end

#segmentsObject

Returns the value of attribute segments

Returns:

  • (Object)

    the current value of segments



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def segments
  @segments
end

#srcObject

Returns the value of attribute src

Returns:

  • (Object)

    the current value of src



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def src
  @src
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



5
6
7
# File 'lib/gpx_doctor/models/track.rb', line 5

def type
  @type
end

Instance Method Details

#pointsObject



15
16
17
# File 'lib/gpx_doctor/models/track.rb', line 15

def points
  segments.flat_map(&:points)
end