Class: ModSpox::Messages::Outgoing::Privmsg
- Inherits:
-
Object
- Object
- ModSpox::Messages::Outgoing::Privmsg
- Defined in:
- lib/mod_spox/messages/outgoing/Privmsg.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ctcp_type ⇒ Object
readonly
type of CTCP message.
-
#message ⇒ Object
readonly
the message.
-
#target ⇒ Object
readonly
target for the message.
Instance Method Summary collapse
-
#initialize(target, message, action = false, ctcp = false, ctcp_type = nil) ⇒ Privmsg
constructor
- target
- target for the message message
-
message to be sent Send a message to user or channel.
-
#is_action? ⇒ Boolean
is message an action.
-
#is_ctcp? ⇒ Boolean
is message CTCP.
Constructor Details
#initialize(target, message, action = false, ctcp = false, ctcp_type = nil) ⇒ Privmsg
- target
-
target for the message
- message
-
message to be sent
Send a message to user or channel. Setting action to true is a shortcut to setting ctcp parameters. The action parameter will override the ctcp parameters if all are set
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mod_spox/messages/outgoing/Privmsg.rb', line 16 def initialize(target, , action=false, ctcp=false, ctcp_type=nil) @target = target @message = @action = action @ctcp = ctcp @ctcp_type = ctcp_type.upcase unless ctcp_type.nil? if(@action) @ctcp = true @ctcp_type = 'ACTION' end if(!@action && !@ctcp_type.nil?) @action = true if @ctcp_type == 'ACTION' end end |
Instance Attribute Details
#ctcp_type ⇒ Object (readonly)
type of CTCP message
10 11 12 |
# File 'lib/mod_spox/messages/outgoing/Privmsg.rb', line 10 def ctcp_type @ctcp_type end |
#message ⇒ Object (readonly)
the message
8 9 10 |
# File 'lib/mod_spox/messages/outgoing/Privmsg.rb', line 8 def @message end |
#target ⇒ Object (readonly)
target for the message
6 7 8 |
# File 'lib/mod_spox/messages/outgoing/Privmsg.rb', line 6 def target @target end |
Instance Method Details
#is_action? ⇒ Boolean
is message an action
32 33 34 |
# File 'lib/mod_spox/messages/outgoing/Privmsg.rb', line 32 def is_action? return @action end |
#is_ctcp? ⇒ Boolean
is message CTCP
37 38 39 |
# File 'lib/mod_spox/messages/outgoing/Privmsg.rb', line 37 def is_ctcp? return @ctcp end |