Module: X::Objects::Actions::Lists
- Included in:
- X::Objects::API
- Defined in:
- x-objects/lib/x/objects/actions/lists.rb
Overview
Create, update, delete, follow, and pin lists 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
-
#add_list_member(list, user) ⇒ Boolean
Add a member to a list as the authenticated user.
-
#create_list(name, **params) ⇒ List
Create a list owned by the authenticated user.
-
#delete_list(list) ⇒ Boolean
Delete a list as the authenticated user.
-
#follow_list(list) ⇒ Boolean
Follow a list as the authenticated user.
-
#pin_list(list) ⇒ Boolean
Pin a list as the authenticated user.
-
#remove_list_member(list, user) ⇒ Boolean
Remove a member from a list as the authenticated user.
-
#unfollow_list(list) ⇒ Boolean
Unfollow a list as the authenticated user.
-
#unpin_list(list) ⇒ Boolean
Unpin a list as the authenticated user.
-
#update_list(list, **params) ⇒ Boolean
Update the name, description, or privacy of a list as the authenticated user.
Instance Method Details
#add_list_member(list, user) ⇒ Boolean
Add a member to a list as the authenticated user
62 63 64 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 62 def add_list_member(list, user) List.from_id(list, client: self).add_member(user) end |
#create_list(name, **params) ⇒ List
Create a list owned by the authenticated user
26 27 28 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 26 def create_list(name, **params) List.create(name, client: self, **params) end |
#delete_list(list) ⇒ Boolean
Delete a list as the authenticated user
50 51 52 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 50 def delete_list(list) List.delete(list, client: self) end |
#follow_list(list) ⇒ Boolean
Follow a list as the authenticated user
85 86 87 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 85 def follow_list(list) User.from_id(current_user_id, client: self).follow_list(list) end |
#pin_list(list) ⇒ Boolean
Pin a list as the authenticated user
107 108 109 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 107 def pin_list(list) User.from_id(current_user_id, client: self).pin_list(list) end |
#remove_list_member(list, user) ⇒ Boolean
Remove a member from a list as the authenticated user
74 75 76 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 74 def remove_list_member(list, user) List.from_id(list, client: self).remove_member(user) end |
#unfollow_list(list) ⇒ Boolean
Unfollow a list as the authenticated user
96 97 98 |
# File 'x-objects/lib/x/objects/actions/lists.rb', line 96 def unfollow_list(list) User.from_id(current_user_id, client: self).unfollow_list(list) end |