Module: X::Objects::Actions::Relationships
- Included in:
- X::Objects::API
- Defined in:
- x-objects/lib/x/objects/actions/relationships.rb
Overview
Follow, block, and mute users as the authenticated user
Internal to x-objects: X::Objects::API includes it, and its methods are public API of the client that includes API, but the module is only how they are grouped, and some of them need the methods of another, so include API rather than this module alone.
Instance Method Summary collapse
-
#block(user) ⇒ Boolean
Block a user as the authenticated user.
-
#follow(user) ⇒ Boolean
Follow a user as the authenticated user.
-
#mute(user) ⇒ Boolean
Mute a user as the authenticated user.
-
#unblock(user) ⇒ Boolean
Unblock a user as the authenticated user.
-
#unfollow(user) ⇒ Boolean
Unfollow a user as the authenticated user.
-
#unmute(user) ⇒ Boolean
Unmute a user as the authenticated user.
Instance Method Details
#block(user) ⇒ Boolean
Block a user as the authenticated user
50 51 52 |
# File 'x-objects/lib/x/objects/actions/relationships.rb', line 50 def block(user) User.from_id(current_user_id, client: self).block(user) end |
#follow(user) ⇒ Boolean
Follow a user as the authenticated user
A protected user must accept a request to follow them first, so for a protected user true means the follow was requested, not that the authenticated user follows them: until they accept it, the follows? of the authenticated user, as in client.current_user!.follows?(user), answers false.
28 29 30 |
# File 'x-objects/lib/x/objects/actions/relationships.rb', line 28 def follow(user) User.from_id(current_user_id, client: self).follow(user) end |
#mute(user) ⇒ Boolean
Mute a user as the authenticated user
72 73 74 |
# File 'x-objects/lib/x/objects/actions/relationships.rb', line 72 def mute(user) User.from_id(current_user_id, client: self).mute(user) end |
#unblock(user) ⇒ Boolean
Unblock a user as the authenticated user
61 62 63 |
# File 'x-objects/lib/x/objects/actions/relationships.rb', line 61 def unblock(user) User.from_id(current_user_id, client: self).unblock(user) end |