Class: Hipbot::Message
- Inherits:
-
Struct
- Object
- Struct
- Hipbot::Message
- Includes:
- Cache
- Defined in:
- lib/hipbot/message.rb
Constant Summary collapse
- MENTION_REGEXP =
/@(\p{Word}++):?/.freeze
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#raw_body ⇒ Object
Returns the value of attribute raw_body.
-
#room ⇒ Object
Returns the value of attribute room.
-
#sender ⇒ Object
Returns the value of attribute sender.
Instance Method Summary collapse
- #for?(user) ⇒ Boolean
-
#initialize(*args) ⇒ Message
constructor
A new instance of Message.
- #private? ⇒ Boolean
Methods included from Cache
Constructor Details
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/hipbot/message.rb', line 6 def body @body end |
#raw_body ⇒ Object
Returns the value of attribute raw_body
3 4 5 |
# File 'lib/hipbot/message.rb', line 3 def raw_body @raw_body end |
#room ⇒ Object
Returns the value of attribute room
3 4 5 |
# File 'lib/hipbot/message.rb', line 3 def room @room end |
#sender ⇒ Object
Returns the value of attribute sender
3 4 5 |
# File 'lib/hipbot/message.rb', line 3 def sender @sender end |
Instance Method Details
#for?(user) ⇒ Boolean
17 18 19 |
# File 'lib/hipbot/message.rb', line 17 def for? user recipients.include? user.mention end |
#private? ⇒ Boolean
29 30 31 |
# File 'lib/hipbot/message.rb', line 29 def private? room.nil? end |