Categories: None [Edit]

constrain

https://rubygems.org/gems/constrain
https://github.com/clrgit/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)

Total

Ranking: 41,125 of 189,321
Downloads: 29,379

Daily

Ranking: 32,122 of 189,284
Downloads: 2

Depended by

RankDownloadsName
19,01288,535prick
21,31473,718shellopts
57,41318,715pg_graph
79,10511,807fixture_fox
81,88711,201modular_tree
82,17011,139qrpm
82,42911,088postspec
174,0862,322sqlsnip
183,674918dumps

Depends on

RankDownloadsName
99442,543,989simplecov

Owners

#GravatarHandle
1iconclrgem