RubyGems Navigation menu

constrain 0.3.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:
= クリップボードにコピー コピー完了!

インストール:
=

バージョン履歴:

  1. 0.10.0 - December 18, 2023 (10.5KB)
  2. 0.9.0 - January 21, 2023 (10KB)
  3. 0.8.0 - September 17, 2022 (10KB)
  4. 0.7.0 - September 03, 2022 (10KB)
  5. 0.6.0 - July 20, 2022 (10KB)
  6. 0.3.2 - October 24, 2021 (10KB)
全てのバージョンを表示(全19件)

Development依存関係 (1):

simplecov >= 0

所有者:

プッシュ者:

作者:

  • Claus Rasmussen

SHA 256チェックサム:

5f87e7ab00e1c567a3f2734b8a98827555a59a54853d0d476105ea14680eca1a

累計ダウンロード数 21,746

このバージョンのみ 1,330

ライセンス:

N/A

必要なRubyのバージョン: >= 2.3.0

リンク: