Class: DistributedPress::V1::Social::Followers
- Inherits:
-
Object
- Object
- DistributedPress::V1::Social::Followers
- Defined in:
- lib/distributed_press/v1/social/followers.rb
Overview
Manages the actor’s followers on the Social Inbox
Instance Attribute Summary collapse
- #actor ⇒ String readonly
- #client ⇒ DistributedPress::V1::Social::Client readonly
Instance Method Summary collapse
-
#endpoint ⇒ String
Followers.
-
#get ⇒ HTTParty::Response
Get the actor’s inbox.
-
#initialize(client:, actor:) ⇒ Followers
constructor
A new instance of Followers.
- #remove(id:) ⇒ HTTParty::Response
Constructor Details
#initialize(client:, actor:) ⇒ Followers
Returns a new instance of Followers.
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
#actor ⇒ String (readonly)
15 16 17 |
# File 'lib/distributed_press/v1/social/followers.rb', line 15 def actor @actor end |
#client ⇒ DistributedPress::V1::Social::Client (readonly)
12 13 14 |
# File 'lib/distributed_press/v1/social/followers.rb', line 12 def client @client end |
Instance Method Details
#endpoint ⇒ String
Followers
42 43 44 |
# File 'lib/distributed_press/v1/social/followers.rb', line 42 def endpoint @endpoint ||= "/v1/#{actor}/followers" end |
#get ⇒ HTTParty::Response
Get the actor’s inbox
27 28 29 |
# File 'lib/distributed_press/v1/social/followers.rb', line 27 def get client.get(endpoint: endpoint) end |
#remove(id:) ⇒ 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 |