Class: Flamethrower::Irc::Message
- Inherits:
-
Object
- Object
- Flamethrower::Irc::Message
- Defined in:
- lib/flamethrower/irc/message.rb
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(message) ⇒ Message
constructor
A new instance of Message.
- #parameters ⇒ Object
- #parse ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(message) ⇒ Message
Returns a new instance of Message.
4 5 6 |
# File 'lib/flamethrower/irc/message.rb', line 4 def initialize() @message = end |
Instance Method Details
#command ⇒ Object
14 15 16 |
# File 'lib/flamethrower/irc/message.rb', line 14 def command parse[:command] end |
#parameters ⇒ Object
18 19 20 |
# File 'lib/flamethrower/irc/message.rb', line 18 def parameters parse[:params] end |
#parse ⇒ Object
8 9 10 11 12 |
# File 'lib/flamethrower/irc/message.rb', line 8 def parse terms = @message.split("\s") params = terms - [terms.first] {:command => terms.first, :params => strip_prefixes(params)} end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/flamethrower/irc/message.rb', line 22 def to_s @message end |