1. Computing
Send to a Friend via Email

Question and Answer

How do you do X in Ruby? Why does doing Y raise an exception? Here, you will find the answer to many such questions.

What is the Difference Between alias and #alias_method?
Why is there both an 'alias' keyword and an 'alias_method' method? Why are both needed? And why is the alias keyword so strange?

Can't Modify Frozen String
I'm trying to modify a frozen String object, but I keep getting a "can't modify frozen String" exception. Why is it doing this? How can I fix it?

Challenge: Sequence of Integers
A challenge: Given an integer, write a method that takes an integer and must return an array containing all the integers from 1 to that integer.

What are 'taint' and 'trust'?
What are these "taint" and "trust" method? I call them, and it seems to set the appropriate flags, but it doesn't seem to do anything. What do these really do?

Variables Declared in the Global Scope
I declared a variable in the global scope, just like I do in C programs, and now I can't access it from a method. What's going on here?

©2014 About.com. All rights reserved.