Ruby: Direct the "embedded" Ruby interpreter from R

Description Usage Arguments Value Author(s)

Description

These functions allow the R user to direct the embedded Ruby interpreter to perform useful operations. These include loading/requiring a Ruby file, creating an instance of a Ruby class, invoking a Ruby method, evaluating a Ruby command given as a string and retrieving a global variable in the Ruby interpreter.

Usage

1
2
3
4
5
.Ruby(obj, method, ..., .args = list(...), converter = NULL)
.RubyEval(cmd, converter = NULL) 
.RubyGet (var, converter = NULL) 
.RubyNew(class, ..., .args = list(...), converter = NULL) 
.RubyRequire(file) 

Arguments

obj

the reference to the Ruby object (of class RubyObject or RubyRef) whose method is to be invoked.

method

a character string giving the name of the method to invoke

...

arguments to the method call

.args

a single list containing the arguments for the method call. This can be a more convenient way to pass the arguments programmatically.

converter

a value controlling how the resulting Ruby value is converted to R. This can be a logical value indicating whether to convert or leave as a reference. In the future, it can also be an R function or a NativeSymbolInfo object that is used to perform the conversion.

cmd

a character string whose content is a Ruby command/expression that will be evaluated by the Ruby interpreter.

var

a character string giving the name of the Ruby global variable to be retrieved.

class

either a character string giving the name of the Ruby class or the the a RubyClass-class object.

file

a character string giving the name of the Ruby source file to be loaded. This will be passed to path.expand and so ~ will be expanded.

Value

These functions typically return an arbitrary Ruby object which is typically converted to an R object.

Author(s)

Duncan Temple Lang


omegahat/RRuby documentation built on May 24, 2019, 1:55 p.m.