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

module­_eval
class_eval
instan­ce_eval
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

method­_mi­ssing (Symbol method, *args, &b­lock)
Called if no method found
method­_added (Symbol method)
Called on method added to self
method­_re­moved (Symbol method)
Called on method removed from self