Skip to content
Snippets Groups Projects
Commit 657ebcc5 authored by Alex Reisner's avatar Alex Reisner
Browse files

Extend to_degrees to convert an entire array.

parent b91a54d3
No related branches found
No related tags found
No related merge requests found
......@@ -116,9 +116,15 @@ module Geocoder
##
# Convert radians to degrees.
# If an array is passed, converts each value and returns array.
#
def to_degrees(radians)
(radians * 180.0) / Math::PI
def to_degrees(*args)
args = args.first if args.first.is_a?(Array)
if args.size == 1
(args.first * 180.0) / Math::PI
else
args.map{ |i| to_degrees(i) }
end
end
##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment