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: 38,362 of 197,744
Downloads: 34,990

Daily

Ranking: 31,092 of 197,724
Downloads: 5

Depended by

RankDownloadsName
17,923109,937prick
20,01191,046shellopts
55,09121,411pg_graph
75,24013,761fixture_fox
75,29413,744postspec
77,32813,204qrpm
79,09712,758modular_tree
170,2702,974sqlsnip
189,2631,084dumps

Depends on

RankDownloadsName
97511,923,440simplecov

Owners

#GravatarHandle
1iconclrgem