Skip to Content
Metaprogramming Ruby 2
book

Metaprogramming Ruby 2

by Paolo Perrotta
August 2014
Intermediate to advanced
250 pages
6h 20m
English
Pragmatic Bookshelf
Content preview from Metaprogramming Ruby 2

Wrap-Up

Here are a few spells and other interesting things that you learned today:

  • What Scope Gates (Scope Gate) are and how Ruby manages scope in general

  • How to make bindings visible through scopes with Flat Scopes (Flat Scope) and Shared Scopes (Shared Scope)

  • How to execute code in an object’s scope (usually with instance_eval or instance_exec), or even in a Clean Room (Clean Room)

  • How to turn a block into an object (a Proc) and back

  • How to turn a method into an object (a Method or an UnboundMethod) and back

  • What the differences are between the different types of callable objects: blocks, Procs, lambdas, and plain old methods

  • How to write your own little DSL

That was a lot of new stuff in a single day. As you sneak out of the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Ruby Programming Language

The Ruby Programming Language

David Flanagan, Yukihiro Matsumoto
Head First Ruby

Head First Ruby

Jay McGavren
Eloquent Ruby

Eloquent Ruby

Russ Olsen

Publisher Resources

ISBN: 9781941222751Errata Page