<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,18 +17,40 @@ Embed the Mozilla Rhino Javascript interpreter into Ruby
 1. Ruby Objects goes into Javascript
 1. Our shark's in the Javascript!
 
+  require 'rhino'
+  
 # evaluate some simple javascript
-
-  Rhino::Context.open do |context|
-    context.eval(&quot;7 * 6&quot;) #=&gt; 42
-  end
-
+  eval_js &quot;7 * 6&quot; #=&gt; 42
+  
 # evaluate a ruby function from javascript
   
   Rhino::Context.open do |context|
     context[&quot;say&quot;] = lambda {|word, times| word * times}
     context.eval(&quot;say(&quot;Hello&quot;, 3)&quot;) #=&gt; HelloHelloHello
   end
+  
+# embed a ruby object into your javascript environment
+
+  class MyMath
+    def plus(lhs, rhs)
+      lhs + rhs
+    end
+  end
+
+  Rhino::Context.open do |context|
+    context[&quot;math&quot;] = MyMath.new
+    context.eval(&quot;math.plus(20,22)&quot;) #=&gt; 42
+  end
+  
+# make a ruby object *be* your javascript environment
+  math = MyMath.new
+  Rhino::Context.open(:with =&gt; math) do |context|
+    context.eval(&quot;plus(20,22)&quot;) #=&gt; 42
+  end
+  
+  #or the equivalent
+  
+  math.eval_js(&quot;plus(20,22)&quot;)
 
 # Configure your embedding setup
 </diff>
      <filename>README.rdoc</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>88707e09e2790f066b9b1be55d23973cddf09abd</id>
    </parent>
  </parents>
  <author>
    <name>Charles Lowell</name>
    <email>cowboyd@thefrontside.net</email>
  </author>
  <url>http://github.com/cowboyd/therubyrhino/commit/aa0a2a999b99aa4b087bd8029455e341f6319b3d</url>
  <id>aa0a2a999b99aa4b087bd8029455e341f6319b3d</id>
  <committed-date>2009-11-13T09:33:08-08:00</committed-date>
  <authored-date>2009-11-13T09:33:08-08:00</authored-date>
  <message>README.rdoc</message>
  <tree>917d0bd0bffe112a43459be2bda6cfc712777786</tree>
  <committer>
    <name>Charles Lowell</name>
    <email>cowboyd@thefrontside.net</email>
  </committer>
</commit>
