module Google::Maps
Constants
- VERSION
Public Class Methods
distance(from, to, options = {})
click to toggle source
# File lib/google-maps.rb, line 19 def self.distance(from, to, options = {}) Route.new(from, to, options_with_defaults(options)).distance.text end
distance_matrix(from, to, options = {})
click to toggle source
# File lib/google-maps.rb, line 35 def self.distance_matrix(from, to, options = {}) DistanceMatrix.new(from, to, options_with_defaults(options)) end
duration(from, to, options = {})
click to toggle source
# File lib/google-maps.rb, line 23 def self.duration(from, to, options = {}) Route.new(from, to, options_with_defaults(options)).duration.text end
geocode(address, language = default_language)
click to toggle source
# File lib/google-maps.rb, line 39 def self.geocode(address, language = default_language) Location.find(address, language) rescue ZeroResultsException [] end
place(place_id, language = default_language)
click to toggle source
# File lib/google-maps.rb, line 31 def self.place(place_id, language = default_language) PlaceDetails.find(place_id, language) end
places(keyword, language = default_language)
click to toggle source
# File lib/google-maps.rb, line 27 def self.places(keyword, language = default_language) Place.find(keyword, language) end
route(from, to, options = {})
click to toggle source
# File lib/google-maps.rb, line 15 def self.route(from, to, options = {}) Route.new(from, to, options_with_defaults(options)) end
Protected Class Methods
options_with_defaults(options)
click to toggle source
# File lib/google-maps.rb, line 48 def options_with_defaults(options) { language: default_language }.merge(options) end