module GoogleCivic::Request

Public Instance Methods

get(path,options={}) click to toggle source
# File lib/google-civic/request.rb, line 5
def get(path,options={})
  request(:get, path, body=nil, options)
end
post(path, body, options={}) click to toggle source
# File lib/google-civic/request.rb, line 9
def post(path, body, options={})
  request(:post, path, body, options)
end

Private Instance Methods

request(method, path, body, options) click to toggle source
# File lib/google-civic/request.rb, line 15
def request(method, path, body, options)
  response = connection.send(method) do |request|
    request.url(path,  options.merge(:key => @key))
    request.body = body.to_json
  end
  response.body
end