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,145 of 193,214
Downloads: 30,464

Daily

Ranking: 37,933 of 193,188
Downloads: 7

Depended by

RankDownloadsName
18,75995,348prick
20,89780,014shellopts
56,07020,026pg_graph
77,05612,715fixture_fox
79,53812,119postspec
79,63612,097modular_tree
79,96712,029qrpm
170,3442,720sqlsnip
185,354995dumps

Depends on

RankDownloadsName
97470,376,754simplecov

Owners

#GravatarHandle
1iconclrgem