Package com.benlangfeld.ruby_speech

Source Code of com.benlangfeld.ruby_speech.RubySpeechService

package com.benlangfeld.ruby_speech;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.load.BasicLibraryService;

public class RubySpeechService implements BasicLibraryService {
  public boolean basicLoad(Ruby ruby) {
    RubyModule ruby_speech = ruby.defineModule("RubySpeech");
    RubyModule grxml = ruby_speech.defineModuleUnder("GRXML");
    RubyClass matcher = grxml.defineClassUnder("Matcher", ruby.getObject(), new ObjectAllocator() {
      public IRubyObject allocate(Ruby runtime, RubyClass rubyClass) {
        return new RubySpeechGRXMLMatcher(runtime, rubyClass);
      }
    });
    matcher.defineAnnotatedMethods(RubySpeechGRXMLMatcher.class);
    return true;
  }
}
TOP

Related Classes of com.benlangfeld.ruby_speech.RubySpeechService

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.