Class: GeocodeAddressJob

Inherits:
Struct
  • Object
show all
Defined in:
app/models/job/geocode_address_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(geocodeable) ⇒ GeocodeAddressJob

Returns a new instance of GeocodeAddressJob.



2
3
4
# File 'app/models/job/geocode_address_job.rb', line 2

def initialize(geocodeable)
	@geocodeable = geocodeable
end

Instance Attribute Details

#geocodeableObject

Returns the value of attribute geocodeable

Returns:

  • (Object)

    the current value of geocodeable



1
2
3
# File 'app/models/job/geocode_address_job.rb', line 1

def geocodeable
  @geocodeable
end

Instance Method Details

#performObject



6
7
8
9
# File 'app/models/job/geocode_address_job.rb', line 6

def perform
	latlong_array = @geocodeable.geocode
	@geocodeable.update_attributes(lat: latlong_array.first, long: latlong_array.last)
end