dawarich/app/jobs/reverse_geocoding_job.rb

18 lines
349 B
Ruby
Raw Normal View History

2024-04-26 12:59:58 -04:00
# frozen_string_literal: true
2024-03-15 18:27:31 -04:00
class ReverseGeocodingJob < ApplicationJob
2024-04-26 12:59:58 -04:00
queue_as :reverse_geocoding
2024-03-15 18:27:31 -04:00
2024-08-05 15:23:08 -04:00
def perform(klass, id)
return unless REVERSE_GEOCODING_ENABLED
2024-08-05 15:23:08 -04:00
data_fetcher(klass, id).call
end
private
def data_fetcher(klass, id)
"ReverseGeocoding::#{klass.pluralize.camelize}::FetchData".constantize.new(id)
2024-03-15 18:27:31 -04:00
end
end