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



388
389
390
391
392
393
394
395
396
# File 'backend/app/lib/rest.rb', line 388

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

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

  val
end