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: 39,373 of 196,125
Downloads: 33,197

Daily

Ranking: 12,894 of 196,106
Downloads: 21

Depended by

RankDownloadsName
18,320103,303prick
20,47885,528shellopts
55,25320,988pg_graph
75,61813,427fixture_fox
77,04913,059postspec
79,02612,566modular_tree
79,06012,559qrpm
169,4242,924sqlsnip
187,6071,060dumps

Depends on

RankDownloadsName
98493,495,493simplecov

Owners

#GravatarHandle
1iconclrgem