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.



12
13
14
# File 'lib/noaa-weather.rb', line 12

def address
  @address
end

#geocodingObject

Returns the value of attribute geocoding.



12
13
14
# File 'lib/noaa-weather.rb', line 12

def geocoding
  @geocoding
end

Instance Method Details

#cached?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/noaa-weather.rb', line 22

def cached?
  @cached ||= false
end

#geocodeObject



14
15
16
17
18
19
20
# File 'lib/noaa-weather.rb', line 14

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