Class: DistributedPress::V1::Social::Likes
- Inherits:
-
Object
- Object
- DistributedPress::V1::Social::Likes
- Defined in:
- lib/distributed_press/v1/social/likes.rb
Overview
Manages the activity’s likes
Instance Attribute Summary collapse
-
#activity ⇒ String
readonly
Activity ID (URL).
- #actor ⇒ String readonly
- #client ⇒ DistributedPress::V1::Social::Client readonly
Instance Method Summary collapse
-
#endpoint ⇒ String
Replies.
-
#get ⇒ HTTParty::Response
Get the activities replies collection.
-
#initialize(client:, actor:, activity:) ⇒ Likes
constructor
A new instance of Likes.
Constructor Details
#initialize(client:, actor:, activity:) ⇒ Likes
Returns a new instance of Likes.
23 24 25 26 27 |
# File 'lib/distributed_press/v1/social/likes.rb', line 23 def initialize(client:, actor:, activity:) @client = client @actor = actor @activity = activity end |
Instance Attribute Details
#activity ⇒ String (readonly)
Returns Activity ID (URL).
18 19 20 |
# File 'lib/distributed_press/v1/social/likes.rb', line 18 def activity @activity end |
#actor ⇒ String (readonly)
15 16 17 |
# File 'lib/distributed_press/v1/social/likes.rb', line 15 def actor @actor end |
#client ⇒ DistributedPress::V1::Social::Client (readonly)
12 13 14 |
# File 'lib/distributed_press/v1/social/likes.rb', line 12 def client @client end |
Instance Method Details
#endpoint ⇒ String
Replies
40 41 42 |
# File 'lib/distributed_press/v1/social/likes.rb', line 40 def endpoint @endpoint ||= "/v1/#{actor}/inbox/likes/#{Base64.encode64(activity).delete("\n")}" end |
#get ⇒ HTTParty::Response
Get the activities replies collection. Authenticated requests contain the list of replies.
33 34 35 |
# File 'lib/distributed_press/v1/social/likes.rb', line 33 def get client.get(endpoint: endpoint) end |