class SimpleOpenWeatherMap::HttpConnection
Public Class Methods
new(uri)
click to toggle source
# File lib/simple_open_weather_map/http_connection.rb, line 6 def initialize(uri) @uri = uri end
Public Instance Methods
get_contents(params = {})
click to toggle source
# File lib/simple_open_weather_map/http_connection.rb, line 10 def get_contents(params = {}) client = ::HTTPClient.new client.get_content(url_with_params(params)) end
Protected Instance Methods
url_with_params(params = {})
click to toggle source
# File lib/simple_open_weather_map/http_connection.rb, line 17 def url_with_params(params = {}) encoded_params = URI.encode_www_form(params) [@uri, encoded_params].join("?") end