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,959 of 186,959
Downloads: 27,106

Daily

Ranking: 26,378 of 186,713
Downloads: 29

Depended by

RankDownloadsName
20,38474,640prick
22,35764,603shellopts
60,89316,365pg_graph
86,4869,655modular_tree
86,8009,595qrpm
87,3759,488fixture_fox
95,0858,302postspec
177,6511,525sqlsnip
181,815719dumps

Depends on

RankDownloadsName
99413,507,374simplecov

Owners

#GravatarHandle
1iconclrgem