in jobs/V3/commute_search_sample.rb [51:76]
def run_commute_search_sample arguments
require "google/apis/jobs_v3"
command = arguments.shift
commute_method = arguments.shift
travel_duration = arguments.shift
default_project_id = "projects/#{ENV['GOOGLE_CLOUD_PROJECT']}"
case command
when "commute_search"
location_arr = arguments.shift.split ","
location = Google::Apis::JobsV3::LatLng.new latitude: location_arr[0].to_f,
longitude: location_arr[1].to_f
job_discovery_commute_search project_id: default_project_id,
commute_method: commute_method,
travel_duration: travel_duration,
start_coordinates: location
else
puts <<~USAGE
Usage: bundle exec ruby commute_search_sample.rb [command] [arguments]
Commands:
commute_search <commute_method> <travel_duration> <start_coordinates> Search a job based on commute details from given location. Location format "latitude,longtitude"
Environment variables:
GOOGLE_CLOUD_PROJECT must be set to your Google Cloud project ID
USAGE
end
end