class Object
Object
and Classes are overidden to make it easier for to exchange data between the Java accessor and Ruby accessor
Constants
- IS_FROM_JAR
- ROOT_DIR
Public Class Methods
attr_java(*args)
click to toggle source
# File lib/fumoffu/java_mapping.rb, line 11 def self.attr_java(*args) args.each do |arg| str_arg = arg.to_s define_method str_arg do send "get"+str_arg.split("_").collect(){|n| n.capitalize}.to_s end define_method str_arg.to_s+"=" do |val| send "set"+str_arg.split("_").collect(){|n| n.capitalize}.to_s, val end end end
Public Instance Methods
import_for_ruby()
click to toggle source
# File lib/fumoffu/generators/templates/engine/config/initializers/app_classes.rb, line 22 def import_for_ruby lib_dir = ROOT_DIR+"/engine/src" dirs = [ "utils", "commons", "models", "actions/controllers", "actions/helpers", "actions/handlers" ] # Example of additional src directory # dirs << "db" dirs.each do |dir| Dir[lib_dir+"/#{dir}/*.rb"].each {|file| require file } end end
import_from_jar()
click to toggle source
¶ ↑
IMPORT ALL CLASS AND FILES FROM THE PROJECT
# File lib/fumoffu/generators/templates/engine/config/initializers/app_classes.rb, line 6 def import_from_jar # Example # this is used to import java generated file from the jar # within the application which will be running in java # you need to put the name of all the required class %w[ controller handler application_controller application_handler ].each do |c| require c end end