Sha256: b4c0c6f7ff3f895f11cfdca3b93e0858316177c0d4075904b26206f05a558443

Contents?: true

Size: 1.72 KB

Versions: 24

Compression:

Stored size: 1.72 KB

Contents

package hitimes;

import java.lang.Math;
import java.lang.System;

import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyModule;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyException;
import org.jruby.RubyModule;
import org.jruby.RubyObject;

import org.jruby.exceptions.RaiseException;


/**
 * @author <a href="mailto:jeremy@hinegardner.org">Jeremy Hinegardner</a>
 */
@JRubyModule( name = "Hitimes" )
public class Hitimes {

    public static RubyClass hitimesIntervalClass;
    /**
     * Create the Hitimes module and add it to the Ruby runtime.
     */
    public static RubyModule createHitimes( Ruby runtime ) {
        RubyModule mHitimes = runtime.defineModule("Hitimes");

        RubyClass  cStandardError = runtime.getStandardError();
        RubyClass  cHitimesError  = mHitimes.defineClassUnder("Error", cStandardError, cStandardError.getAllocator());

        RubyClass  cHitimesStats  = mHitimes.defineClassUnder("Stats", runtime.getObject(), HitimesStats.ALLOCATOR );
        cHitimesStats.defineAnnotatedMethods( HitimesStats.class );

        RubyClass  cHitimesInterval  = mHitimes.defineClassUnder("Interval", runtime.getObject(), HitimesInterval.ALLOCATOR );
        Hitimes.hitimesIntervalClass = cHitimesInterval;
        cHitimesInterval.defineAnnotatedMethods( HitimesInterval.class );

        return mHitimes;
    }

    static RaiseException newHitimesError( Ruby runtime, String message ) {
        RubyClass errorClass = runtime.getModule("Hitimes").getClass( "Error" );
        return new RaiseException( RubyException.newException( runtime, errorClass, message ), true );
    }



    @JRubyClass( name = "Hitimes::Error", parent = "StandardError" )
    public static class Error {};

}

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
hitimes-1.2.6-x86-mingw32 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.6-java ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.6 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.5-java ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.5-x86-mingw32 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.5 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.4-java ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.4-x86-mingw32 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.4 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.3-x86-mingw32 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.3-java ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.3 ext/hitimes/java/src/hitimes/Hitimes.java
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/hitimes-1.2.2/ext/hitimes/java/src/hitimes/Hitimes.java
vagrant-cloudstack-1.1.0 vendor/bundle/gems/hitimes-1.2.2/ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.2-x86-mingw32 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.2-x86-mswin32-60 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.2-java ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.2 ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.1-java ext/hitimes/java/src/hitimes/Hitimes.java
hitimes-1.2.1-x86-mswin32 ext/hitimes/java/src/hitimes/Hitimes.java