module JavaHead
The namespace for the classes
Constants
- CLASSPATH
An array of Pathnames representing the
CLASSPATHenvironment variable Defaults to the current values of the $CLASSPATH environment variable- VERSION
Public Class Methods
Returns the class with no arguments Returns a new class with the given name if an argument is passed
@param [String] name the name of the class to initialize @return [JavaHead::Class] the resulting class
# File lib/java_head.rb, line 27 def class(name = nil) return super() if name.eql? nil JavaHead::Class.new(name) end
Try to load the file const_name if the constant cannot be found
@param [String] const_name @return [Regexp,Array,Class] the value of the constant const_name in the namespace of JavaHead
# File lib/java_head.rb, line 52 def const_missing(const_name) require "#{__dir__}/java_head/#{const_name.to_s.downcase}.rb" return const_get const_name rescue LoadError super end
Creates either a class or a package depending on the format of the given string
@param [String] name the name of the child element @return [JavaHead::Package, JavaHead::Class] the resulting package or class object
# File lib/java_head.rb, line 37 def member(name) if name.match JavaHead::Class::FORMAT self.class(name) else package(name) end end
Find a package using Package.get
@param [String] name the name of the package to be found @return [JavaHead::Package] the package corresponding to name
# File lib/java_head.rb, line 18 def package(name) JavaHead::Package.get(name) end