Note that when you use the assignment operator, =, to assign one array variable to another variable, you are actually assigning a reference to the array itself – you are not making a copy.
Note that when you use the assignment operator, =, to assign one array variable to another variable, you are actually assigning a reference to the array itself – you are not making a copy.
You can also make assignments by indexing into an array. Here, for example, first create an empty array then put items into indexes 0, 1 and 3.
Be careful to note the difference between concatenating using + to add the values from the second array to the first and appending using << to add the second array as the final element of the first
A very simple program-writing program
Enter code at prompt. Enter blank line to eval
Enter l to list program and q to quit
Most of the time you will probably embed rather simple bits of code between the #{ and } delimiters in double-quoted strings. Often you might embed variable names, say, or mathematical expressions:
If a method with the same name is defined for an ancestor of that class, the ancestor class method is not removed.
In addition to creating new methods, there may be times when you want to remove existing methods. You can do this using remove_method within the scope of a given class.
The method_missing method can also take a list of incoming arguments (*args) after the missing method name