RubyGems Navigation menu

constrain 0.5.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:
= Copier Copié!

installation:
=

Versions:

  1. 0.10.0 - December 18, 2023 (10,5 ko)
  2. 0.9.0 - January 21, 2023 (10 ko)
  3. 0.8.0 - September 17, 2022 (10 ko)
  4. 0.7.0 - September 03, 2022 (10 ko)
  5. 0.6.0 - July 20, 2022 (10 ko)
  6. 0.5.0 - March 06, 2022 (10 ko)
Voir toutes les versions (19)

Dépendances de Development (1):

simplecov >= 0

Propriétaires:

Pushed by:

Auteurs:

  • Claus Rasmussen

Total de contrôle SHA 256:

545d6895507b65c3f30f0af8925eab4aab8f8859cc147b209e38dc534aab7a6c

Total de téléchargements 22 128

Pour cette version 849

License:

aucune

Version de Ruby requise: >= 2.3.0

Liens: