lib/geo_calc/extensions/string.rb in geo_calc-0.7.1 vs lib/geo_calc/extensions/string.rb in geo_calc-0.7.3

- old
+ new

@@ -1,19 +1,6 @@ class String - include ::GeoPoint::CoreExtension - - def concat *args - args.inject(self) do |res, arg| - res << arg.to_s - res - end - end - - def parse_dms - GeoCalc::Dms::Converter.parse_dms self - end - def to_rad parse_dms.to_rad end def trim @@ -31,14 +18,18 @@ def to_lng_lat geo_clean.split(',').to_lng_lat end def to_lat - raise "An empty String has no latitude" if empty? - geo_clean.parse_dms.to_f.to_lat + raise "An empty String has no latitude" if self.empty? + s = geo_clean + s = s.parse_dms if s.respond_to? :parse_dms + s.to_f.to_lat end def to_lng - raise "An empty String has no latitude" if empty? - geo_clean.parse_dms.to_f.to_lng + raise "An empty String has no latitude" if self.empty? + s = geo_clean + s = s.parse_dms if s.respond_to? :parse_dms + s.to_f.to_lng end end \ No newline at end of file