Get the latest tech news
Implementing a simple object system from scratch in Ruby
“What I cannot create, I do not understand.” – Richard Feynman
We’ll implement method lookup, prototypical inheritance, mixins and some form of metaprogramming. Let’s create a module, which will serve as a namespace for our constructor and other utility functions related to our class. Anonmyous functions we store in the hash object are closures, so they capture the environment in which they were defined.
Or read this on Hacker News