Skip to content
Browse files

WIP: Some smaller helper methods as well as

adding all dependencies
  • Loading branch information...
1 parent f485016 commit de528af6fed25ff1f5136e81a9c61b3b5ecf6678 @nateklaiber nateklaiber committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 lib/geo_position.rb
View
17 lib/geo_position.rb
@@ -9,9 +9,26 @@
# Conversions
require File.join(root, 'geo_position', 'conversion')
require File.join(root, 'geo_position', 'conversion', 'dms')
+require File.join(root, 'geo_position', 'conversion', 'latitude')
+require File.join(root, 'geo_position', 'conversion', 'longitude')
# Parsers
require File.join(root, 'geo_position', 'parser')
+require File.join(root, 'geo_position', 'parser', 'dms')
module GeoPosition
+ def self.from_dms(degrees, minutes, seconds, direction)
+ conversion = GeoPosition::Conversion::Dms.new(degrees, minutes, seconds, direction)
+ conversion.to_f
+ end
+
+ def self.from_latitude(latitude)
+ conversion = GeoPosition::Conversion::Latitude.new(latitude)
+ conversion.to_s
+ end
+
+ def self.from_longitude(longitude)
+ conversion = GeoPosition::Conversion::Longitude.new(longitude)
+ conversion.to_s
+ end
end

0 comments on commit de528af

Please sign in to comment.
Something went wrong with that request. Please try again.