KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jruby > runtime > NilCallable


1 /*
2  * NilCallable.java
3  *
4  * Created on December 24, 2006, 1:16 AM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.jruby.runtime;
11
12 import org.jruby.internal.runtime.methods.AbstractCallable;
13 import org.jruby.runtime.builtin.IRubyObject;
14
15 /**
16  *
17  * @author headius
18  */

19 public class NilCallable extends AbstractCallable{
20     public static final NilCallable NIL_CALLABLE = new NilCallable();
21     
22     public NilCallable() {
23     }
24
25     public IRubyObject call(ThreadContext context, IRubyObject receiver, IRubyObject[] args, Block block) {
26         return context.getRuntime().getNil();
27     }
28
29     public ICallable dup() {
30         return this;
31     }
32 }
33
Popular Tags