Class: RESTHelpers::NonNegativeInteger

Inherits:
Object
  • Object
show all
Defined in:
backend/app/lib/rest.rb

Class Method Summary collapse

Class Method Details

.value(s) ⇒ Object



407
408
409
410
411
412
413
414
415
# File 'backend/app/lib/rest.rb', line 407

def self.value(s)
  val = Integer(s)

  if val < 0
    raise ArgumentError.new("Invalid non-negative integer value: #{s}")
  end

  val
end