Top Description Methods
org.jruby.embed

public Interface EmbedRubyRuntimeAdapter

extends RubyRuntimeAdapter
Known Direct Implementers
org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl
Imports
java.io.InputStream, .Reader, org.jruby.RubyRuntimeAdapter

Wrapper interface of RubyRuntimeAdapter for embedding. This interface defines Java friendly parse methods.
Author
Yoko Harada <[email protected]>

Method Summary

Modifier and TypeMethod and Description
public EmbedEvalUnit

Returns:

an object which can be run
parse
(String
is a Ruby script to be parsed
script
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Parses a script and return an object which can be run().

public EmbedEvalUnit

Returns:

an object which can be run
parse
(Reader
is used to read a script from
reader
,
String
is used as in information, for example, appears in a stack trace of an exception
filename
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Parses a script given by a reader and return an object which can be run().

public EmbedEvalUnit

Returns:

an object which can be run
parse
(PathType
is one of the types PathType defines
type
,
String
is used as in information, for example, appears in a stack trace of an exception
filename
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Parses a script read from a specified path and return an object which can be run().

public EmbedEvalUnit

Returns:

an object which can be run
parse
(InputStream
is an input stream to get a script from
istream
,
String
filename is used as in information, for example, appears in a stack trace of an exception
filename
,
int...
are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.
lines
)

Parses a script given by a input stream and return an object which can be run().

Inherited from org.jruby.RubyRuntimeAdapter:
evalparseparse

Method Detail

parseback to summary
public EmbedEvalUnit parse(String script, int... lines)

Parses a script and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
script:String

is a Ruby script to be parsed

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public EmbedEvalUnit parse(Reader reader, String filename, int... lines)

Parses a script given by a reader and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
reader:Reader

is used to read a script from

filename:String

is used as in information, for example, appears in a stack trace of an exception

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public EmbedEvalUnit parse(PathType type, String filename, int... lines)

Parses a script read from a specified path and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
type:PathType

is one of the types PathType defines

filename:String

is used as in information, for example, appears in a stack trace of an exception

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run

parseback to summary
public EmbedEvalUnit parse(InputStream istream, String filename, int... lines)

Parses a script given by a input stream and return an object which can be run(). This allows the script to be parsed once and evaluated many times.

Parameters
istream:InputStream

is an input stream to get a script from

filename:String

filename is used as in information, for example, appears in a stack trace of an exception

lines:int[]

are linenumbers to display for parse errors and backtraces. This field is optional. Only the first argument is used for parsing. When no line number is specified, 0 is applied to.

Returns:EmbedEvalUnit

an object which can be run