ruby_function
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | ruby_function [2006/08/29 20:18] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: ruby_function.txt, | ||
+ | ======Synopsis: | ||
+ | $ruby(// | ||
+ | |||
+ | ======Purpose: | ||
+ | If EPIC was linked with an embedded ruby interpreter, | ||
+ | shall be executed by ruby. If EPIC was not linked against ruby, then no | ||
+ | action shall take place. | ||
+ | |||
+ | As all //ruby statement// | ||
+ | object shall be converted into a String object, and further into an | ||
+ | ircII string and returned. | ||
+ | " | ||
+ | |||
+ | If the //ruby statement// has an error, the result is undefined, but usually | ||
+ | an error message is output to the window and the empty string is returned. | ||
+ | |||
+ | Please remember that all function call arguments are subject to ircII | ||
+ | expansion BEFORE the function call occurs. | ||
+ | that are special to both ircII and ruby are quoted so ircII doesn' | ||
+ | to honor them. | ||
+ | |||
+ | You can call back to EPIC from ruby. See /[[ruby command|ruby]] for details. | ||
+ | |||
+ | ======Practical: | ||
+ | $ruby() is useful for loading ruby scripts and modules, defining | ||
+ | simple ruby functions, retrieving variables from within rubyspace and | ||
+ | other general maintenance of the ruby environment. | ||
+ | |||
+ | ======Returns: | ||
+ | The Object.to_s value of the final value of the ruby expression. | ||
+ | handled as a C string in ircII, so it cannot contain nuls. | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | @ruby(rubyvar=' | ||
+ | @epicvar = ruby(rubyvar) Import a ruby variable to EPIC (uses .to_s) | ||
+ | @ruby(1+2*3) Using ruby to do math | ||
+ | [more examples are needed] | ||
+ | </ | ||
+ | |||
+ | ======History: | ||
+ | |||
ruby_function.txt · Last modified: 2006/08/29 20:18 by 127.0.0.1