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

Public Class Methods

config() click to toggle source
# File lib/Time_Traveler/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/Time_Traveler/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/Time_Traveler/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
    })
    print station_rating
  this_station_rating = JSON.load(station_rating.to_s)['results']
end