Module: X::Objects::Actions::Posts
- Included in:
- X::Objects::API
- Defined in:
- x-objects/lib/x/objects/actions/posts.rb
Overview
Create and delete posts 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
-
#create_post(text = nil, **params) ⇒ Post
(also: #create_tweet)
Create a post as the authenticated user.
-
#delete_post(post) ⇒ Boolean
(also: #delete_tweet)
Delete a post as the authenticated user.
-
#hide_reply(post) ⇒ Boolean
Hide a reply to a post of the authenticated user.
-
#unhide_reply(post) ⇒ Boolean
Show a reply to a post of the authenticated user after hiding it.
Instance Method Details
#create_post(text = nil, **params) ⇒ Post Also known as: create_tweet
Create a post as the authenticated user
The API bills each post created, and bills a post whose text holds a URL more than ten times as much. A post needs no text when it has something else to show, such as media.
35 36 37 |
# File 'x-objects/lib/x/objects/actions/posts.rb', line 35 def create_post(text = nil, **params) # steep:ignore DifferentMethodParameterKind Post.create(text, client: self, **params) end |
#delete_post(post) ⇒ Boolean Also known as: delete_tweet
Delete a post as the authenticated user
46 47 48 |
# File 'x-objects/lib/x/objects/actions/posts.rb', line 46 def delete_post(post) Post.delete(post, client: self) end |
#hide_reply(post) ⇒ Boolean
Hide a reply to a post of the authenticated user
57 58 59 |
# File 'x-objects/lib/x/objects/actions/posts.rb', line 57 def hide_reply(post) Post.hide_reply(post, client: self) end |
#unhide_reply(post) ⇒ Boolean
Show a reply to a post of the authenticated user after hiding it
68 69 70 |
# File 'x-objects/lib/x/objects/actions/posts.rb', line 68 def unhide_reply(post) Post.unhide_reply(post, client: self) end |