module ProcessExecuter
def self.spawn_options(obj)
- Api: - public
Raises:
-
(ArgumentError)
- if obj is not a Hash or SpawnOptions
Returns:
-
(SpawnOptions)
-
Parameters:
-
obj
(Hash, SpawnOptions
) -- the object to be converted
def self.spawn_options(obj) case obj when ProcessExecuter::Options::SpawnOptions obj when Hash ProcessExecuter::Options::SpawnOptions.new(**obj) else raise ArgumentError, "Expected a Hash or ProcessExecuter::Options::SpawnOptions but got a #{obj.class}" end end