Class: YammerApi::Client

Inherits:
Object
  • Object
show all
Includes:
Api::Feed, Api::Likes, Api::Messages, Api::Users, Request
Defined in:
lib/yammer_api/client.rb

Constant Summary

Constants included from Request

Request::API_PATH, Request::DEFAULT_HEADERS

Instance Method Summary collapse

Methods included from Api::Users

#user

Methods included from Helper

#params

Methods included from Api::Likes

#add_like, #remove_like

Methods included from Api::Messages

#delete_message, #send_direct_message, #update

Methods included from Api::Feed

#about_topic, #direct_messages, #messages, #messages_from, #messages_received, #messages_sent, #my_feed, #thread

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



9
10
11
12
13
14
# File 'lib/yammer_api/client.rb', line 9

def initialize(options={})
  @consumer_key     = options[:consumer_key]
  @consumer_secret  = options[:consumer_key]
  @auth_token       = options[:oauth_token]
  @consumer_options = options[:oauth_options] || {}
end

Instance Method Details

#access_tokenObject



20
21
22
# File 'lib/yammer_api/client.rb', line 20

def access_token
  @access_token ||= ::OAuth2::AccessToken.new(consumer, @auth_token)
end

#consumerObject



16
17
18
# File 'lib/yammer_api/client.rb', line 16

def consumer
  @consumer ||= ::OAuth2::Client.new(@consumer_key, @consumer_secret, @consumer_options.merge(DEFAULT_OAUTH_OPTIONS))
end