Skip to content

Commit

Permalink
Fix Rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
niborg committed May 21, 2023
1 parent 2a48234 commit d0e93b6
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions lib/gpx/geo_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ def line_strings_to_track(geojson, opts)
coords = ls['geometry']['coordinates']
segment = coords_to_segment(coords)

if opts[:line_string_feature_to_segment]
opts[:line_string_feature_to_segment].call(ls, segment)
end
opts[:line_string_feature_to_segment]&.call(ls, segment)
track.append_segment(segment)
end
track
Expand All @@ -112,9 +110,7 @@ def multi_line_strings_to_tracks(geojson, opts)
track.append_segment(seg)
end

if opts[:multi_line_string_feature_to_track]
opts[:multi_line_string_feature_to_track].call(mls, track)
end
opts[:multi_line_string_feature_to_track]&.call(mls, track)
tracks << track
end
tracks
Expand All @@ -128,11 +124,9 @@ def points_to_waypoints(geojson, gpx_file, opts)
points_in(geojson).reduce([]) do |acc, pt|
coords = pt['geometry']['coordinates']
waypoint = point_to_waypoint(coords, gpx_file)

if opts[:point_feature_to_waypoint]
opts[:point_feature_to_waypoint].call(pt, waypoint)
end


opts[:point_feature_to_waypoint]&.call(pt, waypoint)

acc << waypoint
end
end
Expand All @@ -153,9 +147,7 @@ def multi_points_to_waypoints(geojson, gpx_file, opts)
mpt['geometry']['coordinates'].each do |coords|
waypoint = point_to_waypoint(coords, gpx_file)

if opts[:multi_point_feature_to_waypoint]
opts[:multi_point_feature_to_waypoint].call(mpt, waypoint)
end
opts[:multi_point_feature_to_waypoint]&.call(mpt, waypoint)

acc << waypoint
end
Expand Down

0 comments on commit d0e93b6

Please sign in to comment.