Class: Buddhy::Message
- Inherits:
-
Object
- Object
- Buddhy::Message
- Defined in:
- lib/buddhy/message.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Message
constructor
A new instance of Message.
- #nick ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(data) ⇒ Message
Returns a new instance of Message.
4 5 6 |
# File 'lib/buddhy/message.rb', line 4 def initialize(data) @data = data end |
Instance Method Details
#nick ⇒ Object
8 9 10 |
# File 'lib/buddhy/message.rb', line 8 def nick (match = @data.match(/^:(.*)!/)) && match[1] end |
#text ⇒ Object
12 13 14 |
# File 'lib/buddhy/message.rb', line 12 def text @data.split(':').last end |