Package org.jruby.runtime
Class Binding
java.lang.Object
org.jruby.runtime.Binding
Internal live representation of a block ({...} or do ... end).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBinding
(IRubyObject self) Binding
(IRubyObject self, DynamicScope dynamicScope) Binding
(IRubyObject self, Frame frame, Visibility visibility) Binding
(IRubyObject self, Frame frame, Visibility visibility, DynamicScope dynamicScope) Binding
(IRubyObject self, Frame frame, Visibility visibility, DynamicScope dynamicScope, String method, String filename, int line) Binding
(IRubyObject self, Frame frame, Visibility visibility, DynamicScope dynamicScope, BacktraceElement backtrace) Deprecated.Binding
(Frame frame, DynamicScope dynamicScope, String method, String filename, int line) Binding
(Frame frame, DynamicScope dynamicScope, BacktraceElement backtrace) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the binding.Clone the binding, but maintain a reference to the original "eval binding" to continue sharing eval context.dup
(ThreadContext context) Duplicate this binding and setup the proper cloned instance of the eval scope so that any previously captured variables still exist but are not shared with the original binding.boolean
Deprecated.getDummyScope
(StaticScope staticScope) Gets the dynamicVariables that are local to this block.final DynamicScope
getEvalScope
(Ruby runtime) getFile()
getFrame()
Gets the frame.int
getLine()
getSelf()
int
hashCode()
void
void
setLine
(int line) void
void
setSelf
(IRubyObject self) void
setVisibility
(Visibility visibility)
-
Field Details
-
method
-
filename
-
line
public int line -
DUMMY
Deprecated.
-
-
Constructor Details
-
Binding
public Binding(IRubyObject self, Frame frame, Visibility visibility, DynamicScope dynamicScope, String method, String filename, int line) -
Binding
-
Binding
-
Binding
-
Binding
-
Binding
-
Binding
@Deprecated public Binding(IRubyObject self, Frame frame, Visibility visibility, DynamicScope dynamicScope, BacktraceElement backtrace) Deprecated. -
Binding
Deprecated.
-
-
Method Details
-
cloneForEval
Clone the binding, but maintain a reference to the original "eval binding" to continue sharing eval context.- Returns:
- a new Binding with shared eval context
-
clone
Clone the binding. The frame will be duplicated, and eval context will point to the new binding, but other fields will be copied as-is. -
getVisibility
-
setVisibility
-
getSelf
-
setSelf
-
getDynamicScope
Gets the dynamicVariables that are local to this block. Parent dynamic scopes are also accessible via the current dynamic scope.- Returns:
- Returns all relevant variable scoping information
-
getDummyScope
-
getFrame
Gets the frame.- Returns:
- Returns a RubyFrame
-
getFile
-
setFile
-
getLine
public int getLine() -
setLine
public void setLine(int line) -
getMethod
-
setMethod
-
equals
-
hashCode
public int hashCode() -
getEvalScope
-
getBacktrace
Deprecated. -
dup
Duplicate this binding and setup the proper cloned instance of the eval scope so that any previously captured variables still exist but are not shared with the original binding.- Parameters:
context
- the current thread context- Returns:
- the duplicated binding
-