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,209 of 192,666
Downloads: 30,211

Daily

Ranking: 18,003 of 192,588
Downloads: 44

Depended by

RankDownloadsName
18,84393,828prick
21,06278,283shellopts
56,48419,689pg_graph
77,73812,462fixture_fox
80,28911,873postspec
80,36411,854modular_tree
80,53811,813qrpm
171,2542,635sqlsnip
185,059978dumps

Depends on

RankDownloadsName
99464,871,551simplecov

Owners

#GravatarHandle
1iconclrgem