mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
Merge pull request #154 from kioopi/patch-1
Update README.md example for lambda functions
This commit is contained in:
commit
084c47bc62
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ embed values into the scope of your context
|
||||||
|
|
||||||
embed ruby code into your scope and call it from javascript
|
embed ruby code into your scope and call it from javascript
|
||||||
|
|
||||||
cxt["say"] = lambda {|word, times| word * times}
|
cxt["say"] = lambda {|this, word, times| word * times}
|
||||||
cxt.eval("say('Hello', 3)") #=> HelloHelloHello
|
cxt.eval("say('Hello', 3)") #=> HelloHelloHello
|
||||||
|
|
||||||
embed a ruby object into your scope and access its properties/methods from javascript
|
embed a ruby object into your scope and access its properties/methods from javascript
|
||||||
|
|
Loading…
Add table
Reference in a new issue