Class: CachedGeocode

Inherits:
Object
  • Object
show all
Includes:
GeoKit::Geocoders
Defined in:
lib/noaa-weather.rb

Direct Known Subclasses

Noaaweather

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



25
26
27
# File 'lib/noaa-weather.rb', line 25

def address
  @address
end

#geocodingObject

Returns the value of attribute geocoding.



25
26
27
# File 'lib/noaa-weather.rb', line 25

def geocoding
  @geocoding
end

Instance Method Details

#cached?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/noaa-weather.rb', line 35

def cached?
  @cached ||= false
end

#geocodeObject



27
28
29
30
31
32
33
# File 'lib/noaa-weather.rb', line 27

def geocode
  self.geocoding = gcode_cache_read
  
  {:lat => self.geocoding.lat, 
    :lon => self.geocoding.lng, 
    :site => self.geocoding.city.gsub(/[^a-zA-Z0-9]/,'_')}
end