Sha256: a38fc6945ceb442465c242c55c7e486489db21a33dca1b89ceeb7e477ac5adb9

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

module UndergroundWeather
  class Webcam
    attr_reader :handle, :camid, :camindex, :station_id, :link, 
                :linktext, :cameratype, :organization, :neighborhood,
                :zip, :city, :state, :country, :time_zone, :latitude, 
                :longitude, :updated, :downloaded, :image, :image_thumb, :url
  
    def initialize(wc)
      @handle   = wc['handle']      
      @camid    = wc['camid']
      @camindex = wc['camindex']
      @station_id  = wc['assoc_station_id']
      @camera_type = wc['cameratype']
      
      @link       = wc['link']
      @link_text  = wc['link_text']
      
      @organization = wc['organization']
      @neighborhood = wc['neighborhood']
      @zip          = wc['zip']
      @city         = wc['city']
      @state        = wc['sate']
      @country      = wc['country']
      @time_zone    = wc['tzname']
      @latitude     = wc['lat']
      @longitude    = wc['lon']
      
      @updated_at    = wc['updated']
      @downloaded_at = wc['downloaded'] 
      @is_recent     = wc['isrecent']
      
      @image       = wc['CURRENTIMAGEURL']
      @image_thumb = wc['WIDGETCURRENTIMAGEURL']
      
      @url = wc['CAMURL']           
    end  
  
    def recent
      @is_recent == '1' ? true : false
    end  
    alias_method(:recent?, :recent)
  
  end  
end
  

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
undergroundweather-0.0.3 lib/undergroundweather/webcam.rb
undergroundweather-0.0.2 lib/undergroundweather/webcam.rb
undergroundweather-0.0.1 lib/undergroundweather/webcam.rb