Class: YammerApi::Client
- Inherits:
-
Object
- Object
- YammerApi::Client
- 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
- #access_token ⇒ Object
- #consumer ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Api::Users
Methods included from Helper
Methods included from Api::Likes
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(={}) @consumer_key = [:consumer_key] @consumer_secret = [:consumer_key] @auth_token = [:oauth_token] @consumer_options = [:oauth_options] || {} end |
Instance Method Details
#access_token ⇒ Object
20 21 22 |
# File 'lib/yammer_api/client.rb', line 20 def access_token @access_token ||= ::OAuth2::AccessToken.new(consumer, @auth_token) end |
#consumer ⇒ Object
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 |