| Class | Ym4r::YahooMaps::BuildingBlock::Traffic::Result |
| In: |
lib/ym4r/yahoo_maps/building_block/traffic.rb
|
| Parent: | Struct.new(:type,:title,:description,:latitude,:longitude,:direction,:severity,:report_date,:update_date,:end_date,:image_url) |
Contains a result from the Yahoo! Maps Traffic REST service.
Downloads the image (if there is one) to file.
# File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 92
92: def download_to(file)
93: if has_image?
94: data = open(image_url).read
95: open(file,"wb") do |f|
96: f.write data
97: end
98: end
99: end
# File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 101
101: def has_image?
102: ! image_url.nil?
103: end