Class: Irc::ChannelList

Inherits:
ArrayOf show all
Defined in:
/home/apoc/projects/ruby/rbot/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_if_at, #delete_one, #pick_one, #shuffle, #shuffle!

Constructor Details

- (ChannelList) initialize(ar = [])

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



1492
1493
1494
# File '/home/apoc/projects/ruby/rbot/lib/rbot/irc.rb', line 1492

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

Instance Method Details

- (Object) names

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



1499
1500
1501
# File '/home/apoc/projects/ruby/rbot/lib/rbot/irc.rb', line 1499

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