class Google::InternalGoogleApi
Service for all Google
API calls
Constants
- Google_API_URL
- Google_URL
Setting the URL and parameters
- Return_Type
- Search_Type
Attributes
google_data[R]
Search_URL = URI.join(Google_API_URL
, “#{Parms}”) maps.googleapis.com/maps/api/place/textsearch/xml?query=清華大學&key=AIzaSyADFcZbph8b9jvV5D9zgrlOm2oMQpv6krI
Public Class Methods
config()
click to toggle source
# File lib/VIAJERO/google_api_inter.rb, line 19 def self.config return @config if @config @config = { googlemap_id: ENV['GOOGLE_API'] } end
config=(credentials)
click to toggle source
# File lib/VIAJERO/google_api_inter.rb, line 15 def self.config=(credentials) @config ? @config.update(credentials) : @config = credentials end
this_rating(station)
click to toggle source
# File lib/VIAJERO/google_api_inter.rb, line 24 def self.this_rating(station) return @this_rating if @this_rating station_rating = HTTP.get(Google_API_URL, params: { key: 'AIzaSyADFcZbph8b9jvV5D9zgrlOm2oMQpv6krI', query: station }) this_station_rating = JSON.load(station_rating.to_s)['results'] end