class OTX::Users

Search for, subscribe to, unsubscribe from, follow and unfollow users

Public Instance Methods

action(username, action) click to toggle source

Perform an action on a User

@param useranme [String] Username of the User you wish to perform an action on @param action [String] Action you wish to perform on the User

# File lib/otx_ruby/users.rb, line 91
def action(username, action)
  uri = "/api/v1/users/#{username}/#{action}"

  post(uri)
end
follow(username) click to toggle source

Follow a User

@param useranme [String] Username of the User you wish to follow

# File lib/otx_ruby/users.rb, line 72
def follow(username)
  action(username, 'follow')
end
me() click to toggle source

Validate your API Key configuration. If valid, some basic information about the user account corresponding to the API Key supplied will be returned.

@return [OTX::User] Parsed User

# File lib/otx_ruby/users.rb, line 11
def me
  uri = "/api/v1/users/me"

  json_data = get(uri)

  user = OTX::User.new(json_data)

  return user
end
subscribe_to(username) click to toggle source

Subscribe to a User

@param useranme [String] Username of the User you wish to subscribe to

# File lib/otx_ruby/users.rb, line 54
def subscribe_to(username)
  action(username, 'subscribe')
end
unfollow(username) click to toggle source

Unfollow a User

@param useranme [String] Username of the User you wish to unfollow

# File lib/otx_ruby/users.rb, line 81
def unfollow(username)
  action(username, 'unfollow')
end
unsubscribe_from(username) click to toggle source

Unsubscribe from a User

@param useranme [String] Username of the User you wish to unsubscribe from

# File lib/otx_ruby/users.rb, line 63
def unsubscribe_from(username)
  action(username, 'unsubscribe')
end