Class: IRCSupport::Message::CTCP

Inherits:
Message show all
Defined in:
lib/ircsupport/message.rb

Direct Known Subclasses

CTCPReply

Instance Attribute Summary collapse

Attributes inherited from Message

#channel, #message, #sender

Attributes inherited from IRCSupport::Message

#args, #command, #prefix

Instance Method Summary collapse

Methods inherited from Message

#is_action?, #is_notice?

Methods inherited from IRCSupport::Message

#type

Constructor Details

#initialize(args) ⇒ CTCP

Returns a new instance of CTCP.



593
594
595
596
597
598
599
600
601
602
603
# File 'lib/ircsupport/message.rb', line 593

def initialize(args)
  super(args)
  @sender = args[:prefix]
  @ctcp_args = args[:args][1]
  @ctcp_type = args[:ctcp_type].downcase.to_sym
  @type = "ctcp_#@ctcp_type".to_sym

  if args[:is_public]
    @channel = args[:args][0].split(/,/).first
  end
end

Instance Attribute Details

#ctcp_argsString

Returns The arguments to the CTCP.

Returns:

  • (String)

    The arguments to the CTCP.



590
591
592
# File 'lib/ircsupport/message.rb', line 590

def ctcp_args
  @ctcp_args
end

#ctcp_typeString

Returns The type of the CTCP message.

Returns:

  • (String)

    The type of the CTCP message.



587
588
589
# File 'lib/ircsupport/message.rb', line 587

def ctcp_type
  @ctcp_type
end