module Chatterbot::Utils
Assorted handy utility methods
Public Instance Methods
id_from_tweet(t)
click to toggle source
return the id of a tweet, or the incoming object (likely already an ID)
@param [Tweet] t the Tweet
# File lib/chatterbot/utils.rb, line 11 def id_from_tweet(t) t.is_a?(Twitter::Tweet) ? t.id : t end
id_from_user(u)
click to toggle source
return the id of a User, or the incoming object (likely already an ID)
@param [User] u the User
# File lib/chatterbot/utils.rb, line 20 def id_from_user(u) u.is_a?(Twitter::User) ? u.id : u end