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.

Methods

Public Instance methods

Downloads the image (if there is one) to file.

[Source]

    # 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

[Source]

     # File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 101
101:           def has_image?
102:             ! image_url.nil?
103:           end

Convenience method for the lazy.

[Source]

     # File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 111
111:           def latlon
112:             [latitude,longitude]
113:           end

Convenience method for the lazy.

[Source]

     # File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 106
106:           def lonlat
107:             [longitude,latitude]
108:           end

[Validate]