victorquinn/chancejs — pull request #67 by somejeff (2014-06-29 20:14:44+00:00)
Title: Added String Interpolation

You can interpolate tags within a string!

chance.interpolate("Dear `prefix` `last`, you rolled a `rpg(\"2d5\",{\"sum\":true})`. You win `dollar()`!");
=> Dear Mrs. Chavez, you rolled a 9. You win $4639.83!

To avoid using `eval(tag)`, a utility function called `_parseFunction(Sting)` parses the tag.
Unfortunately, the arguments of the function must be JSON compliant (`rpg('2d5',{sum:true})` won't work.

__Supported tags__

Function name: `bool`
Function with empty args: `bool()`
Function with args `bool({"likelihood":30})` // must be JSON compliant
Function with properties `socialuser.network`