Skip to content

Commit

Permalink
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -22,8 +22,17 @@

Visibility visibility() default Visibility.PUBLIC;

/**
* Defines the method on the singleton class.
* needsSelf is always false.
* */
boolean onSingleton() default false;

/**
* Defines the method as a public on the singleton class
* and as a private instance method.
* needsSelf is always false.
*/
boolean isModuleFunction() default false;

boolean needsSelf() default true;
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ public boolean alive(RubyThread thread) {

}

@CoreMethod(names = "current", isModuleFunction = true, needsSelf = false, maxArgs = 0)
@CoreMethod(names = "current", onSingleton = true, maxArgs = 0)
public abstract static class CurrentNode extends CoreMethodNode {

public CurrentNode(RubyContext context, SourceSection sourceSection) {
@@ -63,7 +63,7 @@ public RubyThread current() {

}

@CoreMethod(names = "exit", isModuleFunction = true, needsSelf = false, maxArgs = 0)
@CoreMethod(names = "exit", onSingleton = true, maxArgs = 0)
public abstract static class ExitModuleNode extends CoreMethodNode {

public ExitModuleNode(RubyContext context, SourceSection sourceSection) {
@@ -141,7 +141,7 @@ public RubyThread join(RubyThread self) {

}

@CoreMethod(names = "pass", needsSelf = false, isModuleFunction = true, maxArgs = 0)
@CoreMethod(names = "pass", onSingleton = true, maxArgs = 0)
public abstract static class PassNode extends CoreMethodNode {

public PassNode(RubyContext context, SourceSection sourceSection) {

0 comments on commit 2a8dfe2

Please sign in to comment.