15 Comments
It’s not a secret, Ruby syntax offers many possibilities. One thing I enjoy doing once in a while is to take some code I have written a few days before and improve it to make it look more rubyish (read : short, expressive and readable).
I thought it could be fun to make a little game […]
Enumerations are an elegant way to make your code more readable. Unfortunately, Ruby doesn’t have a built-in enum type. (Don’t stop reading now! This story ends with hapiness and joy)
To access a class method from an instance, you have to use the reference to that class (because that’s where the method resides). The attribute reader that returns that reference is named class