Class: Evilution::Parallel::WorkQueue::Validators::OptionalPositiveNumber Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/parallel/work_queue/validators/optional_positive_number.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.call!(name, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

  • (ArgumentError)


6
7
8
9
10
# File 'lib/evilution/parallel/work_queue/validators/optional_positive_number.rb', line 6

def self.call!(name, value)
  return if value.nil? || (value.is_a?(Numeric) && value.positive?)

  raise ArgumentError, "#{name} must be nil or a positive number, got #{value.inspect}"
end