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,171 of 193,756
Downloads: 30,585

Daily

Ranking: 71,816 of 193,649
Downloads: 1

Depended by

RankDownloadsName
18,75496,086prick
20,86480,847shellopts
55,99220,147pg_graph
77,03412,780fixture_fox
79,44012,193postspec
79,58112,161modular_tree
79,87912,093qrpm
170,3362,738sqlsnip
185,611998dumps

Depends on

RankDownloadsName
97475,839,609simplecov

Owners

#GravatarHandle
1iconclrgem