lib/ruby_branch/api/request.rb in ruby_branch-0.1.0 vs lib/ruby_branch/api/request.rb in ruby_branch-0.2.0

- old
+ new

@@ -9,9 +9,18 @@ request.body = body unless body.empty? end Response.new(response) end + def put(resource, body = '') + response = connection.put do |request| + request.url resource + request.headers['Content-Type'] = 'application/json' + request.body = body unless body.empty? + end + Response.new(response) + end + def connection @connection ||= Faraday.new(url: BRANCH_API_ENDPOINT) do |connection| connection.adapter Faraday.default_adapter end