Class ArrayOf
In: lib/rbot/irc.rb
Parent: Array

ArrayOf is a subclass of Array whose elements are supposed to be all of the same class. This is not intended to be used directly, but rather to be subclassed as needed (see for example Irc::UserList and Irc::NetmaskList)

Presently, only very few selected methods from Array are overloaded to check if the new elements are the correct class. An orthodox? method is provided to check the entire ArrayOf against the appropriate class.

Methods

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

Attributes

element_class  [R] 

Public Class methods

Create a new ArrayOf whose elements are supposed to be all of type kl, optionally filling it with the elements from the Array argument.

Public Instance methods

Overloaded from Array#&, checks for appropriate class of argument elements

Overloaded from Array#+, checks for appropriate class of argument elements

Overloaded from Array#-, so that an ArrayOf is returned. There is no need to check the validity of the elements in the argument

Overloaded from Array#<<, checks for appropriate class of argument

Overloaded from Array#concat, checks for appropriate class of argument elements

We introduce the ‘downcase’ method, which maps downcase() to all the Array elements, properly failing when the elements don‘t have a downcase method

Overloaded from Array#insert, checks for appropriate class of argument elements

Overloaded from Array#push, checks for appropriate class of argument elements

Overloaded from Array#replace, checks for appropriate class of argument elements

Overloaded from Array#unshift, checks for appropriate class of argument(s)

This method checks that all elements are of the appropriate class

This method is similar to the above, except that it raises an exception if the receiver is not valid

This method checks if the passed arguments are acceptable for our ArrayOf

Overloaded from Array#|, checks for appropriate class of argument elements

[Validate]