class JSON::TruffleRuby::Generator::State

def self.from_state(opts)

returned.
an unconfigured instance. If _opts_ is a State object, it is just
a new State instance configured by _opts_, something else to create
Creates a State object from _opts_, which ought to be Hash to create
def self.from_state(opts)
  if opts
    case
    when self === opts
      return opts
    when opts.respond_to?(:to_hash)
      return new(opts.to_hash)
    when opts.respond_to?(:to_h)
      return new(opts.to_h)
    end
  end
  new
end