Module: Croudia::Rest::FriendShips

Included in:
Client
Defined in:
lib/croudia/rest/friend_ships.rb

Instance Method Summary collapse

Instance Method Details

#follow(params = {}) ⇒ Croudia::Object::User

Allows the authenticating users to follow the user specified in the ID parameter.

Options Hash (params):

  • :screen_name (String)

    The screen name of the user for whom to befriend.

  • :user_id (Integer)

    The ID of the user for whom to befriend.

See Also:



16
17
18
19
# File 'lib/croudia/rest/friend_ships.rb', line 16

def follow(params = {})
  response = post('friendships/create.json', params)
  Croudia::Object::User.new(response)
end

#relationship(params = {}) ⇒ Croudia::Object::Relationship

Returns detailed information about the relationship between two arbitrary users.

Options Hash (params):

  • :source_id (Integer)

    The user_id of the subject user.

  • :source_screen_name (String)

    The screen_name of the subject user.

  • :target_id (Integer)

    The user_id of the target user.

  • :target_screen_name (String)

    The screen_name of the target user.

See Also:



42
43
44
45
# File 'lib/croudia/rest/friend_ships.rb', line 42

def relationship(params = {})
  response = get('friendships/show.json', params)
  Croudia::Object::Relationship.new(response)
end

#relationships(params = {}) ⇒ Croudia::Object::RelationshipCollection

Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided.

Options Hash (params):

  • :user_id (Integer)

    The comma-separated list of user_ids.

  • :screen_name (String)

    The comma-separated list of screen_names.

See Also:



54
55
56
57
# File 'lib/croudia/rest/friend_ships.rb', line 54

def relationships(params = {})
  response = get('friendships/lookup.json', params)
  Croudia::Object::RelationshipCollection.new(response)
end

#unfollow(params = {}) ⇒ Croudia::Object::User

Allows the authenticating user to unfollow the user specified in the ID parameter.

Options Hash (params):

  • :screen_name (String)

    The screen name of the user for whom to unfollow.

  • :user_id (Integer)

    The ID of the user for whom to unfollow.

See Also:



28
29
30
31
# File 'lib/croudia/rest/friend_ships.rb', line 28

def unfollow(params = {})
  response = post('friendships/destroy.json', params)
  Croudia::Object::User.new(response)
end