class Google::GooglePlaceRating
Attributes
rating_rawdata[R]
Public Class Methods
find(query:)
click to toggle source
# File lib/Time_Traveler/internal.rb, line 14 def self.find(query:) rating_rawdata = InternalGoogleApi.this_rating(query) @queryRating_input = {googleapi:ENV['GOOGLE_API'],queryKey:query} new(rating_rawdata,@queryRating_input) end
new(data,input)
click to toggle source
# File lib/Time_Traveler/internal.rb, line 7 def initialize(data,input) @googleapi = ENV['GOOGLE_API'] @queryVal = input[0] rating_analysis(data) @info = data[0] end
Public Instance Methods
return_rating()
click to toggle source
# File lib/Time_Traveler/internal.rb, line 21 def return_rating @info end
Private Instance Methods
rating_analysis(queryresult)
click to toggle source
# File lib/Time_Traveler/internal.rb, line 26 def rating_analysis(queryresult) queryresult.map do |place| @rating = place['rating'] @lat = place['geometry']['location']['lat'] @lng = place['geometry']['location']['lng'] @placeid = place['place_id'] @types = place['types'] @address = place['formatted_address'] @placename = place['name'] end end