From b66d9b0bf391877d0f5f0e891e7e98ee7554d2ca Mon Sep 17 00:00:00 2001 From: Marc Siegel Date: Tue, 16 Jan 2018 14:47:46 -0500 Subject: [PATCH] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 03a8523..5e2882c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ def with_array(arr=[], &block) end ``` -**Easy!** +Easy! ### Wait! Can't I do that with just `instance_eval` or `instance_exec`? @@ -59,7 +59,7 @@ In short: **No**. Not if you want the code in the block to be able to refer to anything the block would normally have access to from the surrounding context. -Let's be very specific. Docile internally uses `instance_exec` (see [execution.rb#25](lib/docile/execution.rb#L25)), adding a small layer to support referencing *local variables*, *instance variables*, and *methods* from the _block's context_ **or** the target _object's context_, interchangeably. This is "the **hard part**", where most folks making a DSL in Ruby throw up their hands. +Let's be very specific. Docile internally uses `instance_exec` (see [execution.rb#25](lib/docile/execution.rb#L25)), adding a small layer to support referencing *local variables*, *instance variables*, and *methods* from the _block's context_ **or** the target _object's context_, interchangeably. This is "**the hard part**", where most folks making a DSL in Ruby throw up their hands. For example: