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: 39,049 of 196,721
Downloads: 33,714

Daily

Ranking: 15,810 of 196,694
Downloads: 19

Depended by

RankDownloadsName
18,163105,303prick
20,19587,989shellopts
55,34121,013pg_graph
75,68213,456fixture_fox
76,79213,161postspec
79,08412,590modular_tree
79,17412,569qrpm
169,8732,928sqlsnip
188,3571,064dumps

Depends on

RankDownloadsName
98499,434,149simplecov

Owners

#GravatarHandle
1iconclrgem