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,510 of 187,224
Downloads: 28,095

Daily

Ranking: 22,950 of 187,196
Downloads: 42

Depended by

RankDownloadsName
19,71380,147prick
21,73068,763shellopts
59,31117,359pg_graph
83,10010,585fixture_fox
83,93210,405modular_tree
84,68410,246qrpm
89,0729,409postspec
176,4271,913sqlsnip
182,183807dumps

Depends on

RankDownloadsName
99421,067,602simplecov

Owners

#GravatarHandle
1iconclrgem