Enum PathType

java.lang.Object
java.lang.Enum<PathType>
org.jruby.embed.PathType
All Implemented Interfaces:
Serializable, Comparable<PathType>, java.lang.constant.Constable

public enum PathType extends Enum<PathType>
The path type that tells from where Ruby runtime should load the specified file.
  • Enum Constant Details

    • ABSOLUTE

      public static final PathType ABSOLUTE
      Given filename is an absolute path.
    • RELATIVE

      public static final PathType RELATIVE
      Given filename is a relative path to a base directory. To set the base directory, use setAttribute() method of ScriptingContainer.
           ScriptingContainer container = new ScriptingContainer();
           container.setAttribute(AttributeName.BASE_DIR, System.getProperty("user.dir"));
           String filename =  "test/ruby/iteration.rb";
           Object receiver = container.runScriptlet(PathType.RELATIVE, filename);
    • CLASSPATH

      public static final PathType CLASSPATH
      Given filename should be found from a classpath.
  • Constructor Details

    • PathType

      private PathType()
  • Method Details

    • values

      public static PathType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PathType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null