RubyGems Navigation menu

constrain 0.10.0

Allows you check if an object match a class expression. It is typically used to check the type of method paraameters. It is an alternative to using Ruby-3 .rbs files but with a different syntax and only dynamic checks Typically you'll include the Constrain module and use #constrain to check the type of method parameters: include Constrain # f takes a String and an array of Integer objects. Raise a Constrain::Error # if parameters doesn't have the expected types def f(a, b) constrain a, String constrain b, [Integer] end Constrain works with ruby-2 (and maybe ruby-3)

Gemfile:
= Copiar al portapapeles ¡Copiado!

instalar:
=

Versiones:

  1. 0.10.0 - December 18, 2023 (10,5 KB)
  2. 0.9.0 - January 21, 2023 (10 KB)
  3. 0.8.0 - September 17, 2022 (10 KB)
  4. 0.7.0 - September 03, 2022 (10 KB)
  5. 0.6.0 - July 20, 2022 (10 KB)
Mostrar todas las versiones (19 total)

dependencias de Development (1):

simplecov >= 0

Propietarios:

Subida por:

Autores:

  • Claus Rasmussen

SHA 256 checksum:

b4bffd5c0d308164bec793cf81a9bdab34a4ec78f26473f54ab637f09122dde6

Total de descargas 21.729

Para esta versión 331

Licencias:

N/A

Versión de Ruby requerida: >= 0

Enlace: