Module: Tweetkit::Client::Tweets

Included in:
Tweetkit::Client
Defined in:
lib/tweetkit/client/tweets.rb

Instance Method Summary collapse

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, **options, &block)
  search = Search.new(query)
  search.setup(&block) if block_given?
  get 'tweets/search/recent', options.merge!({ query: search.combined_query })
end

#tweet(id, **options) ⇒ Object



6
7
8
# File 'lib/tweetkit/client/tweets.rb', line 6

def tweet(id, **options)
  get "tweets/#{id}", options
end

#tweets(ids, **options) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/tweetkit/client/tweets.rb', line 10

def tweets(ids, **options)
  if ids.is_a? Array
    ids = ids.join(',')
  else
    ids = ids.delete(' ')
  end
  get 'tweets', options.merge!({ ids: ids })
end