Show Menu
Cheatography

Ruby Metaprogramming Cheat Sheet (DRAFT) by

Ruby metaprogramming features and methods

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Evaluation Methods

modu­le_­eval
clas­s_e­val
inst­anc­e_e­val
eval
All these methods evaluate string or block in the context or module, class or instance.
Eval method evaluates string [in context of given binding()]

Hook Methods

meth­od_­mis­sing (Symbol method, *args, &b­lock)
Called if no method found
meth­od_­added (Symbol method)
Called on method added to self
meth­od_­rem­oved (Symbol method)
Called on method removed from self