Class: IRCSupport::Message::Numeric353
- Inherits:
-
Numeric
- Object
- IRCSupport::Message
- Numeric
- IRCSupport::Message::Numeric353
- Defined in:
- lib/ircsupport/message.rb
Instance Attribute Summary collapse
-
#channel ⇒ String
The channel.
-
#channel_type ⇒ String
The channel type.
-
#users ⇒ Array
Each element is an array of two elements: the user prefix (if any), and the name of the user.
Attributes inherited from Numeric
Attributes inherited from IRCSupport::Message
Instance Method Summary collapse
-
#initialize(args) ⇒ Numeric353
constructor
A new instance of Numeric353.
Methods inherited from Numeric
Methods inherited from IRCSupport::Message
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
#channel ⇒ String
Returns The channel.
118 119 120 |
# File 'lib/ircsupport/message.rb', line 118 def channel @channel end |
#channel_type ⇒ String
Returns The channel type.
121 122 123 |
# File 'lib/ircsupport/message.rb', line 121 def channel_type @channel_type end |
#users ⇒ Array
Returns 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 |