Class: UndergroundWeather::Webcam

Inherits:
Object
  • Object
show all
Defined in:
lib/undergroundweather/webcam.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wc) ⇒ Webcam

Returns a new instance of Webcam.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/undergroundweather/webcam.rb', line 8

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

Instance Attribute Details

#cameratypeObject (readonly)

Returns the value of attribute cameratype.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def cameratype
  @cameratype
end

#camidObject (readonly)

Returns the value of attribute camid.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def camid
  @camid
end

#camindexObject (readonly)

Returns the value of attribute camindex.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def camindex
  @camindex
end

#cityObject (readonly)

Returns the value of attribute city.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def country
  @country
end

#downloadedObject (readonly)

Returns the value of attribute downloaded.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def downloaded
  @downloaded
end

#handleObject (readonly)

Returns the value of attribute handle.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def handle
  @handle
end

#imageObject (readonly)

Returns the value of attribute image.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def image
  @image
end

#image_thumbObject (readonly)

Returns the value of attribute image_thumb.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def image_thumb
  @image_thumb
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def latitude
  @latitude
end

Returns the value of attribute link.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def link
  @link
end

#linktextObject (readonly)

Returns the value of attribute linktext.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def linktext
  @linktext
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def longitude
  @longitude
end

#neighborhoodObject (readonly)

Returns the value of attribute neighborhood.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def neighborhood
  @neighborhood
end

#organizationObject (readonly)

Returns the value of attribute organization.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def organization
  @organization
end

#stateObject (readonly)

Returns the value of attribute state.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def state
  @state
end

#station_idObject (readonly)

Returns the value of attribute station_id.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def station_id
  @station_id
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def time_zone
  @time_zone
end

#updatedObject (readonly)

Returns the value of attribute updated.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def updated
  @updated
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def url
  @url
end

#zipObject (readonly)

Returns the value of attribute zip.



3
4
5
# File 'lib/undergroundweather/webcam.rb', line 3

def zip
  @zip
end

Instance Method Details

#recentObject Also known as: recent?



38
39
40
# File 'lib/undergroundweather/webcam.rb', line 38

def recent
  @is_recent == '1' ? true : false
end