Class: IRCSupport::Message::Numeric353

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

Instance Attribute Summary collapse

Attributes inherited from Numeric

#name

Attributes inherited from IRCSupport::Message

#args, #command, #prefix

Instance Method Summary collapse

Methods inherited from Numeric

#is_error?

Methods inherited from IRCSupport::Message

#type

Constructor Details

#initialize(args) ⇒ Numeric353

Returns a new instance of Numeric353.



128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/ircsupport/message.rb', line 128

def initialize(args)
  super(args)
  data = @args.last(@args.size - 1)
  @channel_type = data.shift if data[0] =~ /^[@=*]$/
  @channel = data[0]
  @users = []
  prefixes = args[:isupport]["PREFIX"].values.map { |p| Regexp.quote p }

  data[1].split(/\s+/).each do |user|
    user.sub! /^(#{prefixes.join '|'})/, ''
    @users.push [$1, user]
  end
end

Instance Attribute Details

#channelString

Returns The channel.

Returns:

  • (String)

    The channel.



118
119
120
# File 'lib/ircsupport/message.rb', line 118

def channel
  @channel
end

#channel_typeString

Returns The channel type.

Returns:

  • (String)

    The channel type.



121
122
123
# File 'lib/ircsupport/message.rb', line 121

def channel_type
  @channel_type
end

#usersArray

Returns Each element is an array of two elements: the user prefix (if any), and the name of the user.

Returns:

  • (Array)

    Each element is an array of two elements: the user prefix (if any), and the name of the user.



125
126
127
# File 'lib/ircsupport/message.rb', line 125

def users
  @users
end