1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

Sponsored by The Frontside

This commit is contained in:
Logan Lowell 2012-01-26 10:09:04 -06:00
parent ba8a9dd92a
commit bd4a38e668
2 changed files with 8 additions and 5 deletions

View file

@ -48,7 +48,7 @@ embed a ruby object into your scope and access its properties/methods from javas
lhs + rhs
end
end
cxt['math'] = MyMath.new
cxt.eval("math.plus(20,22)") #=> 42
@ -59,7 +59,7 @@ make a ruby object *be* your global javascript scope.
cxt.eval("plus(20,22)") #=> 42
end
you can do the same thing with Object#eval_js
you can do the same thing with Object#eval_js
math.eval_js("plus(20,22)")
@ -96,14 +96,14 @@ exposed by default. E.g.
super
end
end
class B < A
def b
"b"
end
end
V8::Context.new do |cxt|
cxt['a'] = A.new
cxt['b'] = B.new
@ -138,6 +138,9 @@ To use the ruby racer in rails, or any application using Bundler to manage gems,
bundle install
rake compile
## Sponsored by
<a href="http://thefrontside.net">![The Frontside](http://github.com/cowboyd/therubyracer/raw/master/thefrontside.png)</a>
## LICENSE:
(The MIT License)

BIN
thefrontside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB