BETAmodules.com is in beta — open to partnerships & joint ventures.Build with us

constrain

v0.10.0RubyGems· Ruby

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)

The verdict
Abandoned. Last published 2 years ago. No recent activity — look for a maintained alternative.
No recent activity — look for a maintained alternative.
Live from the RubyGems registry · derived rules, not AI
How it scores
MaintenanceAbandoned
PopularityNiche
SecurityClean
LicenseUnknown
DepsZero deps
Maintenance
Last published 2 years ago.
Popularity
16 downloads / week
Security
No known advisories for this version (OSV).
License
No license declared.
Dependencies
No runtime dependencies
Recent releases
  • 0.10.02 years ago
  • 0.9.03 years ago
  • 0.8.03 years ago
  • 0.7.03 years ago
  • 0.6.03 years ago
  • 0.5.14 years ago
  • 0.5.04 years ago
  • 0.4.04 years ago
constrain — 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) (Ruby / RubyGems) · Modules