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: 44,053 of 183,127
Downloads: 23,881

Daily

Ranking: 74,510 of 183,106
Downloads: 0

Depended by

RankDownloadsName
21,59262,987prick
23,08957,143shellopts
64,90314,119pg_graph
91,0508,359modular_tree
92,3918,186qrpm
103,4686,770fixture_fox
115,8075,430postspec
177,520970sqlsnip
179,890558dumps

Depends on

RankDownloadsName
99348,471,616simplecov

Owners

#GravatarHandle
1iconclrgem