Class: Contracts::Builtin::Int

Inherits:
Object
  • Object
show all
Defined in:
lib/contracts-ruby2/lib/contracts/builtin_contracts.rb,
lib/contracts-ruby3/lib/contracts/builtin_contracts.rb

Overview

Check that an argument is an Integer.

Class Method Summary collapse

Class Method Details

.valid?(val) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/contracts-ruby2/lib/contracts/builtin_contracts.rb', line 46

def self.valid? val
  val && val.is_a?(Integer)
end