Class: Yammer::Client

Constant Summary

Constants included from Configurable

Yammer::Configurable::ENDPOINT, Yammer::Configurable::HTTP_ADAPTER

Instance Attribute Summary collapse

Attributes included from Configurable

#http_adapter

Instance Method Summary collapse

Methods included from Api::Activity

#create_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

#create_subscription

Methods included from Api::PendingAttachment

#create_pending_attachment, #delete_pending_attachment, #get_pending_attachment

Methods included from Api::Invitation

#invite

Methods included from Api::Autocomplete

#autocomplete

Methods included from Api::Notification

#notifications

Methods included from Api::Like

#like, #likes_open_graph_object?, #unlike

Methods included from Api::Search

#search

Methods included from Api::Network

#current_networks

Methods included from Api::Topic

#get_topic

Methods included from Api::Thread

#get_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


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_tokenObject

Returns the value of attribute access_token


42
43
44
# File 'lib/yammer/client.rb', line 42

def access_token
  @access_token
end

#client_idObject

Returns the value of attribute client_id


42
43
44
# File 'lib/yammer/client.rb', line 42

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret


42
43
44
# File 'lib/yammer/client.rb', line 42

def client_secret
  @client_secret
end

#connection_optionsObject (readonly)

Returns the value of attribute connection_options


40
41
42
# File 'lib/yammer/client.rb', line 40

def connection_options
  @connection_options
end

#default_headersObject (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_urlObject (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