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: 38,384 of 198,430
Downloads: 35,170

Daily

Ranking: 28,714 of 198,401
Downloads: 6

Depended by

RankDownloadsName
17,832111,851prick
19,97992,136shellopts
55,08421,560pg_graph
74,94413,921postspec
75,06213,888fixture_fox
77,32413,291qrpm
79,22412,812modular_tree
170,3663,004sqlsnip
189,6031,106dumps

Depends on

RankDownloadsName
97518,966,733simplecov

Owners

#GravatarHandle
1iconclrgem