Class: Buddhy::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/buddhy/message.rb

Instance Method Summary collapse

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

#nickObject



8
9
10
# File 'lib/buddhy/message.rb', line 8

def nick
  (match = @data.match(/^:(.*)!/)) && match[1]
end

#textObject



12
13
14
# File 'lib/buddhy/message.rb', line 12

def text
  @data.split(':').last
end