Class: IRCSupport::Message::Numeric

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

Direct Known Subclasses

Numeric005, Numeric352, Numeric353

Instance Attribute Summary collapse

Attributes inherited from IRCSupport::Message

#args, #command, #prefix

Instance Method Summary collapse

Methods inherited from IRCSupport::Message

#type

Constructor Details

#initialize(args) ⇒ Numeric

Returns a new instance of Numeric.



36
37
38
39
40
# File 'lib/ircsupport/message.rb', line 36

def initialize(args)
  super(args)
  @name = IRCSupport::Numerics.numeric_to_name(@command)
  @type = @command.to_sym
end

Instance Attribute Details

#nameString

Returns The name of the IRC command numeric (e.g. RPL_WELCOME).

Returns:

  • (String)

    The name of the IRC command numeric (e.g. RPL_WELCOME).



33
34
35
# File 'lib/ircsupport/message.rb', line 33

def name
  @name
end

Instance Method Details

#is_error?Boolean

Returns Will be true if this is an error numeric.

Returns:

  • (Boolean)

    Will be true if this is an error numeric.



43
44
45
# File 'lib/ircsupport/message.rb', line 43

def is_error?
  return @name =~ /^ERR/ ? true : false
end