Class: Yammer::Client
- Inherits:
-
Object
- Object
- Yammer::Client
- Includes:
- Api::Activity, Api::Autocomplete, Api::Group, Api::GroupMembership, Api::Invitation, Api::Like, Api::Message, Api::Network, Api::Notification, Api::OpenGraphObject, Api::PendingAttachment, Api::Search, Api::Subscription, Api::Thread, Api::Topic, Api::User, Configurable
- Defined in:
- lib/yammer/client.rb
Constant Summary
Constants included from Configurable
Yammer::Configurable::ENDPOINT, Yammer::Configurable::HTTP_ADAPTER
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#connection_options ⇒ Object
readonly
Returns the value of attribute connection_options.
-
#default_headers ⇒ Object
readonly
Returns the value of attribute default_headers.
-
#site_url ⇒ Object
readonly
Returns the value of attribute site_url.
Attributes included from Configurable
Instance Method Summary collapse
-
#delete(path, params = {}) ⇒ Object
makes a DELETE request.
-
#get(path, params = {}) ⇒ Object
makes a GET request.
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
-
#post(path, params = {}) ⇒ Object
makes a POST request.
-
#put(path, params = {}) ⇒ Object
makes a PUT request.
Methods included from Api::Activity
Methods included from Api::OpenGraphObject
#create_open_graph_object, #follow_open_graph_object, #get_activity_stream_open_graph_objects, #is_following_open_graph_object?
Methods included from Api::Subscription
Methods included from Api::PendingAttachment
#create_pending_attachment, #delete_pending_attachment, #get_pending_attachment
Methods included from Api::Invitation
Methods included from Api::Autocomplete
Methods included from Api::Notification
Methods included from Api::Like
#like, #likes_open_graph_object?, #unlike
Methods included from Api::Search
Methods included from Api::Network
Methods included from Api::Topic
Methods included from Api::Thread
Methods included from Api::Message
#all_messages, #create_message, #delete_message, #followed_messages, #get_message, #like_message, #messages_about_topic, #messages_for_open_graph_object, #messages_from_user, #messages_in_group, #messages_in_thread, #messages_liked_by, #messages_received, #messages_sent, #private_messages, #unlike_message
Methods included from Api::GroupMembership
#create_group_membership, #get_group_membership
Methods included from Api::Group
#all_groups, #create_group, #get_group, #groups_for_user, #update_group
Methods included from Api::User
#all_users, #create_user, #current_user, #delete_user, #get_user, #get_user_by_email, #update_user, #users_followed_by, #users_following, #users_in_group
Methods included from Configurable
#configure, default_options, #disable_logging, #enable_logging, keys, #options, #reset!, #with_logging
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/yammer/client.rb', line 44 def initialize(opts={}) Yammer::Configurable.keys.each do |key| case key when :headers, :connection_options value = Yammer.instance_variable_get(:"@#{key}").merge(opts.fetch(key, {})) else value = opts.fetch(key, Yammer.instance_variable_get(:"@#{key}")) end instance_variable_set(:"@#{key}", value) end end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
42 43 44 |
# File 'lib/yammer/client.rb', line 42 def access_token @access_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
42 43 44 |
# File 'lib/yammer/client.rb', line 42 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
42 43 44 |
# File 'lib/yammer/client.rb', line 42 def client_secret @client_secret end |
#connection_options ⇒ Object (readonly)
Returns the value of attribute connection_options.
40 41 42 |
# File 'lib/yammer/client.rb', line 40 def @connection_options end |
#default_headers ⇒ Object (readonly)
Returns the value of attribute default_headers.
40 41 42 |
# File 'lib/yammer/client.rb', line 40 def default_headers @default_headers end |
#site_url ⇒ Object (readonly)
Returns the value of attribute site_url.
40 41 42 |
# File 'lib/yammer/client.rb', line 40 def site_url @site_url end |
Instance Method Details
#delete(path, params = {}) ⇒ Object
makes a DELETE request
72 73 74 |
# File 'lib/yammer/client.rb', line 72 def delete(path, params={}) request(:delete, path, params) end |
#get(path, params = {}) ⇒ Object
makes a GET request
57 58 59 |
# File 'lib/yammer/client.rb', line 57 def get(path, params={}) request(:get, path, params) end |
#post(path, params = {}) ⇒ Object
makes a POST request
67 68 69 |
# File 'lib/yammer/client.rb', line 67 def post(path, params={}) request(:post, path, params) end |
#put(path, params = {}) ⇒ Object
makes a PUT request
62 63 64 |
# File 'lib/yammer/client.rb', line 62 def put(path, params={}) request(:put, path, params) end |