| Module | WeatherReportLocation |
| In: |
lib/weather_report.rb
|
Module to load and provide accessors for shared location specific
| TITLE | = | /(.+) for ([\w -\.]*), ([\w -\.]*)/ |
| country | [R] | |
| latitude | [R] | |
| longtitude | [R] | |
| name | [R] |
load the location based data (name, country, latitude, longtitude) from the backstage feed
# File lib/weather_report.rb, line 76 def loadLocation(xmlDoc) xmlDoc.elements.each("rss/channel/title") { |element| md = TITLE.match(element.text) @name = md[2] if md @country = md[3] if md } xmlDoc.elements.each("rss/channel/item[1]/geo:lat") { |element| @latitude = element.text.to_f } xmlDoc.elements.each("rss/channel/item[1]/geo:long") { |element| @longtitude = element.text.to_f } end