class ProcessExecuter::Options::SpawnWithTimeoutOptions
Defines options for {ProcessExecuter.spawn_with_timeout}
@api public
Private Instance Methods
Source
# File lib/process_executer/options/spawn_with_timeout_options.rb, line 18 def define_options [ *super, OptionDefinition.new(:timeout_after, default: nil, validator: method(:validate_timeout_after)) ].freeze end
The options allowed for objects of this class @return [Array<OptionDefinition>] @api private
Calls superclass method
ProcessExecuter::Options::SpawnOptions#define_options
Source
# File lib/process_executer/options/spawn_with_timeout_options.rb, line 35 def validate_timeout_after(_key, _value) return if timeout_after.nil? return if timeout_after.is_a?(Numeric) && timeout_after.real? && !timeout_after.negative? errors << "timeout_after must be nil or a non-negative real number but was #{timeout_after.inspect}" end
Note an error if timeout_after is not nil or a non-negative real number
@param _key [Symbol] the option key (not used)
@param _value [Object] the option value (not used)
@return [void]
@api private