lib/yammer/client.rb in yammer-client-0.1.1 vs lib/yammer/client.rb in yammer-client-0.1.2
- old
+ new
@@ -13,11 +13,11 @@
include Yammer::Api::Thread
include Yammer::Api::Topic
include Yammer::Api::Network
include Yammer::Api::Search
include Yammer::Api::Notification
- include Yammer::Api::Autocomplete
+ include Yammer::Api::Autocomplete
attr_writer :connection_options
attr_accessor :site_url, :http_adapter
def initialize(opts={})
@@ -64,22 +64,22 @@
private
# Makes an HTTP request using the provided parameters
# @raise [Yammer::Error::Unauthorized]
- # @param method [string]
+ # @param method [string]
# @param path [string]
# @param params [Hash]
# @param opts [Hash]
# @return [Yammer::Response]
# @!visibility private
def request(method, path, params={}, opts={})
- # Log request here
+ headers = opts.fetch(:headers, {}).merge({
+ 'Authorization' => "Bearer #{@access_token}"
+ })
response = connection.send_request(method, path, {
:params => params,
- :headers => {
- 'Authorization' => "Bearer #{@access_token}"
- }
+ :headers => headers
})
result = Yammer::Response.new(response)
status = result.code
case status
when 200...400