Class: Irc::ChannelList

Inherits:
ArrayOf show all
Defined in:
lib/rbot/irc.rb

Overview

A ChannelList is an ArrayOf Channels

Instance Attribute Summary

Attributes inherited from ArrayOf

#element_class

Instance Method Summary collapse

Methods inherited from ArrayOf

#&, #+, #-, #<<, #concat, #downcase, #insert, #inspect, #push, #replace, #unshift, #valid?, #validate, #will_accept?, #|

Methods inherited from Array

#delete_one, #pick_one, #shuffle, #shuffle!

Constructor Details

#initialize(ar = []) ⇒ ChannelList

Create a new ChannelList, optionally filling it with the elements from the Array argument fed to it.



1492
1493
1494
# File 'lib/rbot/irc.rb', line 1492

def initialize(ar=[])
  super(Channel, ar)
end

Instance Method Details

#namesObject

Convenience method: convert the ChannelList to a list of channel names. The indices are preserved



1499
1500
1501
# File 'lib/rbot/irc.rb', line 1499

def names
  self.map { |chan| chan.name }
end