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,213 of 189,899
Downloads: 29,467

Daily

Ranking: 37,125 of 189,874
Downloads: 4

Depended by

RankDownloadsName
18,93389,753prick
21,24774,569shellopts
57,13318,927pg_graph
78,97911,892fixture_fox
81,33211,374modular_tree
81,73111,289qrpm
81,87011,258postspec
172,5952,439sqlsnip
183,905921dumps

Depends on

RankDownloadsName
99447,225,906simplecov

Owners

#GravatarHandle
1iconclrgem