Class: Hipbot::User
- Inherits:
-
Object
- Object
- Hipbot::User
- Defined in:
- lib/hipbot/user.rb
Instance Method Summary collapse
- #first_name ⇒ Object
- #guest? ⇒ Boolean
- #mention ⇒ Object
- #myself? ⇒ Boolean
- #send_message(message) ⇒ Object
Instance Method Details
#first_name ⇒ Object
11 12 13 |
# File 'lib/hipbot/user.rb', line 11 def first_name name.split.first end |
#guest? ⇒ Boolean
19 20 21 |
# File 'lib/hipbot/user.rb', line 19 def guest? attributes[:role] == 'visitor' end |
#mention ⇒ Object
7 8 9 |
# File 'lib/hipbot/user.rb', line 7 def mention attributes[:mention] || name.gsub(/\s+/, '') end |
#myself? ⇒ Boolean
15 16 17 |
# File 'lib/hipbot/user.rb', line 15 def myself? self == Hipbot.user end |
#send_message(message) ⇒ Object
3 4 5 |
# File 'lib/hipbot/user.rb', line 3 def Hipbot.send_to_user self, end |