Package org.jruby.api

Class Check

java.lang.Object
org.jruby.api.Check

public class Check extends Object
  • Constructor Details

    • Check

      public Check()
  • Method Details

    • checkEmbeddedNulls

      public static RubyString checkEmbeddedNulls(ThreadContext context, IRubyObject obj)
      Check to see if the supplied object (which is convertable to a string) contains any null (\0) bytes. It will throw an ArgumentError if so and a TypeError is obj is not a string{able}.
      Parameters:
      context - the current thread context
      obj - object to be made into a string and checked for NULLs
      Returns:
      the converted str (or original if no conversion happened).
    • checkID

      public static RubySymbol checkID(ThreadContext context, IRubyObject obj)
      Convert the supplied object into an internal identifier String. Basically, symbols are stored internally as raw bytes from whatever encoding they were originally sourced from. When methods are stored they must also get stored in this same raw fashion so that if we use symbols to look up methods or make symbols from these method names they will match up. For 2.2 compatibility, we also force all incoming identifiers to get anchored as hard-referenced symbols.