Module: Chatterbot::Utils
- Included in:
- Bot
- Defined in:
- lib/chatterbot/utils.rb
Overview
Assorted handy utility methods
Instance Method Summary collapse
-
#id_from_tweet(t) ⇒ Object
return the id of a tweet, or the incoming object (likely already an ID).
-
#id_from_user(u) ⇒ Object
return the id of a User, or the incoming object (likely already an ID).
Instance Method Details
#id_from_tweet(t) ⇒ Object
return the id of a tweet, or the incoming object (likely already an ID)
11 12 13 |
# 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) ⇒ Object
return the id of a User, or the incoming object (likely already an ID)
20 21 22 |
# File 'lib/chatterbot/utils.rb', line 20 def id_from_user(u) u.is_a?(Twitter::User) ? u.id : u end |