RubyGems Navigation menu

constrain 0.2.2

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:
= In die Zwischenablage kopieren Kopiert!

installieren:
=

Versionen:

  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)
  6. 0.2.2 - May 24, 2021 (9,5 KB)
Zeige alle Versionen (19 total)

Development Abhängigkeiten (1):

simplecov >= 0

Besitzer:

Pushed by:

Autoren:

  • Claus Rasmussen

SHA 256-Prüfsumme:

be60803bf9275d7bd4fe5670154624afb5ca41fd5039d91f0bfdfa5ffd71a492

Downloads insgesamt 22.039

Für diese Version 1.741

Lizenzen:

k.A.

Erforderliche Ruby-Version: >= 2.3.0

Links: