class TenkiJp::Client
Constants
- API_BASE_URL
- RequestHeaders
Public Class Methods
api_url(location_id)
click to toggle source
# File lib/tenkijp/client.rb, line 28 def api_url(location_id) "#{API_BASE_URL}forecast_#{location_id}.json" end
exec(location_id)
click to toggle source
# File lib/tenkijp/client.rb, line 20 def exec(location_id) RestClient::Request.execute( method: :get, url: api_url(location_id), headers: RequestHeaders ) end
get(location_id = 13113)
click to toggle source
# File lib/tenkijp/client.rb, line 16 def get(location_id = 13113) JSON.parse exec(location_id) end