class Ym4r::YahooMaps::BuildingBlock::Traffic::Result

Contains a result from the Yahoo! Maps Traffic REST service.

Public Instance Methods

download_to(file) click to toggle source

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

# File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 92
def download_to(file)
  if has_image?
    data = open(image_url).read
    open(file,"wb") do |f|
      f.write data
    end
  end
end
has_image?() click to toggle source
# File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 101
def has_image?
  ! image_url.nil?
end
latlon() click to toggle source

Convenience method for the lazy.

# File lib/ym4r/yahoo_maps/building_block/traffic.rb, line 111
def latlon
  [latitude,longitude]
end
lonlat() click to toggle source

Convenience method for the lazy.

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