module Remindrr::Request

Public Class Methods

extended(base) click to toggle source
# File lib/remindrr/request.rb, line 17
def self.extended(base)
  base.include(InstanceMethods)
end

Public Instance Methods

get(uri) click to toggle source
# File lib/remindrr/request.rb, line 5
def get(uri)
  connection.get(uri).body
end
post(url, attributes) click to toggle source
# File lib/remindrr/request.rb, line 9
def post(url, attributes)
  response = connection.post(url) do |request|
    request.headers['Content-Type'] = 'application/json'
    request.body = attributes.to_json
  end
  response.body.inject({}){ |memo,(k,v)| memo[k.to_sym] = v; memo }
end