Top Fields Constructors Methods
org.jruby.internal.runtime.methods

public Class ProcMethod

extends DynamicMethod
implements PositionAware, IRMethodArgs
Class Inheritance
All Implemented Interfaces
org.jruby.internal.runtime.methods.IRMethodArgs, org.jruby.runtime.PositionAware
Imports
org.jruby.RubyModule, .RubyProc, org.jruby.runtime.ArgumentDescriptor, .Arity, .Block, .BlockBody, .Helpers, .IRBlockBody, .PositionAware, .Signature, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject

Field Summary

Modifier and TypeField and Description
private final RubyProc
Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
aliasCountdefinedClassflagshandleimplementationClassnameprotectedClassserialNumber

Constructor Summary

AccessConstructor and Description
public
ProcMethod(RubyModule implementationClass, RubyProc proc, Visibility visibility, String name)

Constructor for ProcMethod.

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The argument list to this invocation
args
,
Block
The block passed to this invocation
block
)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle.

public DynamicMethod
dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.

public ArgumentDescriptor[]
getArgumentDescriptors()

Implements org.jruby.internal.runtime.methods.IRMethodArgs.getArgumentDescriptors.

Get the array of ArgumentDescriptors that represent the arguments to this method.

public Arity
getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

Retrieve the arity of this method, used for reporting arity to Ruby code.

public String
getFile()

Implements org.jruby.runtime.PositionAware.getFile.

Get the filename for the method.

public int
getLine()

Implements org.jruby.runtime.PositionAware.getLine.

Get the line number for the method.

public RubyProc
public Signature
public boolean
public void
setRuby2Keywords()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setRuby2Keywords.

Implements org.jruby.internal.runtime.methods.IRMethodArgs.setRuby2Keywords.

Indicates the method will behave like a ruby2 keywords accepting method.

Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
adjustAliasCountcalculateProtectedClasscallcallcallcallcallcallcallcallcallcallRespondTogetAliasCountgetCallConfiggetDefinedClassgetHandlegetImplementationClassgetInstanceVariableNamesgetMethodDatagetNamegetProtectedClassgetRealMethodgetSerialNumbergetVisibilityinitinitisBuiltinisCallableFromisImplementedByisNativeisNotImplementedisNullisRefinedisUndefinedsetCallConfigsetDefinedClasssetHandlesetImplementationClasssetIsBuiltinsetNotImplementedsetVisibility

Field Detail

procback to summary
private final RubyProc proc

Constructor Detail

ProcMethodback to summary
public ProcMethod(RubyModule implementationClass, RubyProc proc, Visibility visibility, String name)

Constructor for ProcMethod.

Method Detail

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle. Subclasses must implement this method, but may implement the other signatures to provide faster, non-boxing call paths. Typically subclasses will implement this method to check variable arity calls, then performing a specific-arity invocation to the appropriate method or performing variable-arity logic in-line.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The argument list to this invocation

block:Block

The block passed to this invocation

Returns:IRubyObject

The result of the call

dupback to summary
public DynamicMethod dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.dup.

Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes. It is not required that this method produce a new object if the semantics of the DynamicMethod subtype do not require such.

Returns:DynamicMethod

An identical DynamicMethod object to the target.

getArgumentDescriptorsback to summary
public ArgumentDescriptor[] getArgumentDescriptors()

Implements org.jruby.internal.runtime.methods.IRMethodArgs.getArgumentDescriptors.

Doc from org.jruby.internal.runtime.methods.IRMethodArgs.getArgumentDescriptors.

Get the array of ArgumentDescriptors that represent the arguments to this method.

Returns:ArgumentDescriptor[]

this methods argument descriptors

Annotations
@Override
getArityback to summary
public Arity getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

Retrieve the arity of this method, used for reporting arity to Ruby code. This arity may or may not reflect the actual specific or variable arities of the referenced method.

Returns:Arity

The arity of the method, as reported to Ruby consumers.

Annotations
@Deprecated
@Override
getFileback to summary
public String getFile()

Implements org.jruby.runtime.PositionAware.getFile.

Doc from org.jruby.runtime.PositionAware.getFile.

Get the filename for the method.

Returns:String

the filename for the method

getLineback to summary
public int getLine()

Implements org.jruby.runtime.PositionAware.getLine.

Doc from org.jruby.runtime.PositionAware.getLine.

Get the line number for the method. 0-based (ie. line 1 returns a 0)

Returns:int

the line number for the method

getProcback to summary
public RubyProc getProc()
getSignatureback to summary
public Signature getSignature()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Implements org.jruby.internal.runtime.methods.IRMethodArgs.getSignature.

Doc from org.jruby.internal.runtime.methods.IRMethodArgs.getSignature.

Get the Signature for this method.

Returns:Signature

this methods signature

Annotations
@Override
isSameback to summary
public boolean isSame(DynamicMethod method)
setRuby2Keywordsback to summary
public void setRuby2Keywords()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setRuby2Keywords.

Implements org.jruby.internal.runtime.methods.IRMethodArgs.setRuby2Keywords.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setRuby2Keywords.

Indicates the method will behave like a ruby2 keywords accepting method. This must be a Ruby implementation to work. See Module#ruby2_keywords for information on the semantics of a method which is marked this way.

Annotations
@Override