Module: Tweetkit::Client::Tweets
- Included in:
- Tweetkit::Client
- Defined in:
- lib/tweetkit/client/tweets.rb
Instance Method Summary collapse
- #search(query = '', type: :tweet, **options, &block) ⇒ Object
- #tweet(id, **options) ⇒ Object
- #tweets(ids, **options) ⇒ Object
Instance Method Details
#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.setup(&block) if block_given? get 'tweets/search/recent', .merge!({ query: search.combined_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 |