Class: IRCSupport::Message::Message
- Inherits:
-
IRCSupport::Message
- Object
- IRCSupport::Message
- IRCSupport::Message::Message
- Defined in:
- lib/ircsupport/message.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#channel ⇒ String
The name of the channel this message was sent to, if any.
-
#message ⇒ String
The text of the message.
-
#sender ⇒ String
The user who sent the message.
Attributes inherited from IRCSupport::Message
Instance Method Summary collapse
-
#initialize(args) ⇒ Message
constructor
A new instance of Message.
-
#is_action? ⇒ Boolean
Will be true if this message is an action.
-
#is_notice? ⇒ Boolean
Will be true if this message is a notice.
Methods inherited from IRCSupport::Message
Constructor Details
#initialize(args) ⇒ Message
Returns a new instance of Message.
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/ircsupport/message.rb', line 560 def initialize(args) super(args) @sender = args[:prefix] @message = args[:args][1] @is_action = args[:is_action] || false @is_notice = args[:is_notice] || false if args[:is_public] # broadcast messages are so 90s @channel = args[:args][0].split(/,/).first end if args[:capabilities].include?('identify-msg') @identified = args[:identified] def self.identified?; @identified; end end end |
Instance Attribute Details
#channel ⇒ String
Returns The name of the channel this message was sent to, if any.
557 558 559 |
# File 'lib/ircsupport/message.rb', line 557 def channel @channel end |
#message ⇒ String
Returns The text of the message.
553 554 555 |
# File 'lib/ircsupport/message.rb', line 553 def @message end |
#sender ⇒ String
Returns The user who sent the message.
550 551 552 |
# File 'lib/ircsupport/message.rb', line 550 def sender @sender end |
Instance Method Details
#is_action? ⇒ Boolean
Returns Will be true if this message is an action.
579 |
# File 'lib/ircsupport/message.rb', line 579 def is_action?; @is_action; end |
#is_notice? ⇒ Boolean
Returns Will be true if this message is a notice.
582 |
# File 'lib/ircsupport/message.rb', line 582 def is_notice?; @is_notice; end |