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,415 of 187,571
Downloads: 28,345

Daily

Ranking: 19,104 of 187,548
Downloads: 25

Depended by

RankDownloadsName
19,52781,980prick
21,66169,569shellopts
59,11917,557pg_graph
82,20610,846fixture_fox
83,75710,522modular_tree
84,24710,416qrpm
87,2139,816postspec
176,1082,002sqlsnip
182,351837dumps

Depends on

RankDownloadsName
98425,116,291simplecov

Owners

#GravatarHandle
1iconclrgem