Class: Ahoy::GeocodeJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/ahoy/geocode_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(visit) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ahoy/geocode_job.rb', line 5

def perform(visit)
  deckhand = Deckhands::LocationDeckhand.new(visit.ip)
  Ahoy::VisitProperties::LOCATION_KEYS.each do |key|
    visit.send(:"#{key}=", deckhand.send(key)) if visit.respond_to?(:"#{key}=")
  end
  visit.save!
end