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,187 of 191,254
Downloads: 29,659

Daily

Ranking: 26,080 of 191,174
Downloads: 6

Depended by

RankDownloadsName
18,88890,880prick
21,20375,331shellopts
56,89419,138pg_graph
78,62112,037fixture_fox
81,01911,505modular_tree
81,27611,445postspec
81,31711,437qrpm
172,3312,484sqlsnip
184,198939dumps

Depends on

RankDownloadsName
99453,302,650simplecov

Owners

#GravatarHandle
1iconclrgem