Module: Tweetkit::Client::Tweets
- Included in:
- Tweetkit::Client
- Defined in:
- lib/tweetkit/client/tweets.rb
Instance Method Summary collapse
- #delete_tweet(id) ⇒ Object
- #post_tweet(**options) ⇒ Object
- #search(query = '', type: :tweet, **options, &block) ⇒ Object
- #tweet(id, **options) ⇒ Object
- #tweets(ids, **options) ⇒ Object
Instance Method Details
#delete_tweet(id) ⇒ Object
29 30 31 |
# File 'lib/tweetkit/client/tweets.rb', line 29 def delete_tweet(id) delete "tweets/#{id}" end |
#post_tweet(**options) ⇒ Object
25 26 27 |
# File 'lib/tweetkit/client/tweets.rb', line 25 def post_tweet(**) post "tweets", ** end |
#search(query = '', type: :tweet, **options, &block) ⇒ Object
19 20 21 22 23 |
# File 'lib/tweetkit/client/tweets.rb', line 19 def search(query = '', type: :tweet, **, &block) search = Search.new(query) search.evaluate(&block) if block_given? get 'tweets/search/recent', **.merge!({ query: search.current_query }) end |
#tweet(id, **options) ⇒ Object
6 7 8 |
# File 'lib/tweetkit/client/tweets.rb', line 6 def tweet(id, **) get "tweets/#{id}", ** end |
#tweets(ids, **options) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/tweetkit/client/tweets.rb', line 10 def tweets(ids, **) if ids.is_a? Array ids = ids.join(',') else ids = ids.delete(' ') end get 'tweets', **.merge!({ ids: ids }) end |