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,204 of 188,299
Downloads: 28,947

Daily

Ranking: 14,933 of 188,294
Downloads: 9

Depended by

RankDownloadsName
19,26385,226prick
21,41771,990shellopts
58,02018,266pg_graph
80,33911,404fixture_fox
82,66910,909modular_tree
83,07210,818qrpm
84,67410,481postspec
175,2442,181sqlsnip
182,960891dumps

Depends on

RankDownloadsName
99433,034,919simplecov

Owners

#GravatarHandle
1iconclrgem