Classes are not locked down in Ruby. If you wanted to add the firstName method to the String class, you could call that method on any string. For example …
1
| |
As with most Ruby, the code is simple and straight-forward. Here is code that allows you to write 2.weeks.ago …