Class: Ym4r::YahooMaps::BuildingBlock::MapImage::Result
- Inherits:
-
Struct
- Object
- Struct
- Ym4r::YahooMaps::BuildingBlock::MapImage::Result
- Defined in:
- lib/ym4r/yahoo_maps/building_block/map_image.rb
Overview
Contains a result match from the Yahoo! Maps Map Image service.
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
-
#warning ⇒ Object
Returns the value of attribute warning.
Instance Method Summary collapse
-
#download_to(file) ⇒ Object
Downloads the image to
file. -
#exact_match? ⇒ Boolean
Indicates if the location passed in the request could be exactly identified.
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url
56 57 58 |
# File 'lib/ym4r/yahoo_maps/building_block/map_image.rb', line 56 def url @url end |
#warning ⇒ Object
Returns the value of attribute warning
56 57 58 |
# File 'lib/ym4r/yahoo_maps/building_block/map_image.rb', line 56 def warning @warning end |
Instance Method Details
#download_to(file) ⇒ Object
Downloads the image to file.
59 60 61 62 63 64 |
# File 'lib/ym4r/yahoo_maps/building_block/map_image.rb', line 59 def download_to(file) data = open(url).read open(file,"wb") do |f| f.write data end end |
#exact_match? ⇒ Boolean
Indicates if the location passed in the request could be exactly identified.
67 68 69 |
# File 'lib/ym4r/yahoo_maps/building_block/map_image.rb', line 67 def exact_match? warning.nil? end |