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

Version Path
ez-1.3.0 lib/ez/view_helpers.rb
ez-1.2.0 lib/ez/view_helpers.rb
ez-1.1.3 lib/ez/view_helpers.rb
ez-1.1.2 lib/ez/view_helpers.rb
ez-1.1.1 lib/ez/view_helpers.rb
ez-1.1.0 lib/ez/view_helpers.rb
ez-1.0.0 lib/ez/view_helpers.rb
ez-0.9.9 lib/ez/view_helpers.rb
ez-0.9.7 lib/ez/view_helpers.rb
ez-0.9.6 lib/ez/view_helpers.rb
ez-0.9.5 lib/ez/view_helpers.rb
ez-0.9.1 lib/ez/view_helpers.rb
ez-0.9.0 lib/ez/view_helpers.rb
ez-0.8.7 lib/ez/view_helpers.rb
ez-0.8.6 lib/ez/view_helpers.rb
ez-0.7.0 lib/ez/view_helpers.rb
ez-0.6.5 lib/ez/view_helpers.rb
ez-0.6.4 lib/ez/view_helpers.rb