Class: DistributedPress::V1::Social::Followers

Inherits:
Object
  • Object
show all
Defined in:
lib/distributed_press/v1/social/followers.rb

Overview

Manages the actor’s followers on the Social Inbox

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, actor:) ⇒ Followers

Returns a new instance of Followers.

Parameters:



19
20
21
22
# File 'lib/distributed_press/v1/social/followers.rb', line 19

def initialize(client:, actor:)
  @client = client
  @actor = actor
end

Instance Attribute Details

#actorString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/distributed_press/v1/social/followers.rb', line 15

def actor
  @actor
end

#clientDistributedPress::V1::Social::Client (readonly)



12
13
14
# File 'lib/distributed_press/v1/social/followers.rb', line 12

def client
  @client
end

Instance Method Details

#endpointString

Followers

Returns:

  • (String)


42
43
44
# File 'lib/distributed_press/v1/social/followers.rb', line 42

def endpoint
  @endpoint ||= "/v1/#{actor}/followers"
end

#getHTTParty::Response

Get the actor’s inbox

Returns:

  • (HTTParty::Response)


27
28
29
# File 'lib/distributed_press/v1/social/followers.rb', line 27

def get
  client.get(endpoint: endpoint)
end

#remove(id:) ⇒ HTTParty::Response

Parameters:

  • :id (String)

    Activity ID

Returns:

  • (HTTParty::Response)


35
36
37
# File 'lib/distributed_press/v1/social/followers.rb', line 35

def remove(id:)
  client.delete(endpoint: "#{endpoint}/#{URI.encode_uri_component(id)}")
end