Sha256: c21c9fdc646ae8625c858d7a704e90c6d2435f8331b76d954b2f2f81128ea228
Contents?: true
Size: 535 Bytes
Versions: 18
Compression:
Stored size: 535 Bytes
Contents
module EZ module ViewHelpers def weather(location = 'Evanston, IL') EZ.weather(location) end def map(location, options = {}) defaults = { :zoom => 12, :scale => 1, :size => '400x400', :type => 'hybrid', :sensor => false} parameters = defaults.merge(options) parameters[:center] = location qstring = parameters.keys.map { |key| "#{key}=#{parameters[key]}" }.join('&') url = "http://maps.googleapis.com/maps/api/staticmap?#{qstring}" image_tag URI.escape(url) end end end
Version data entries
18 entries across 18 versions & 1 rubygems