Class: Forem::Services::FollowerService

Inherits:
BaseService show all
Defined in:
lib/forem/services/follower_service.rb

Overview

Service for interacting with the Forem Followers API.

Lists the users who follow the authenticated user. Access via Client#followers. All methods inject the client's requestor automatically so no additional configuration is required.

Examples:

client = Forem::Client.new("your-api-key")
followers = client.followers.list(per_page: 50)

See Also:

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Forem::Services::BaseService

Instance Method Details

#list(params = {}, opts = {}) ⇒ Array<Follower>

List users who follow the authenticated user.

Examples:

client.followers.list(per_page: 100, sort: "created_at")

Parameters:

  • params (Hash) (defaults to: {})

    query parameters

  • opts (Hash) (defaults to: {})

    per-request options

Options Hash (params):

  • :page (Integer)

    page number (default: 1)

  • :per_page (Integer)

    number of results per page (max: 1000)

  • :sort (String)

    sort order ("created_at" for most recent first)

Returns:

  • (Array<Follower>)

    list of followers for the authenticated user

See Also:



29
30
31
# File 'lib/forem/services/follower_service.rb', line 29

def list(params = {}, opts = {})
  Follower.list(params, opts_with_requestor(opts))
end