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,350 of 187,950
Downloads: 28,600

Daily

Ranking: 25,453 of 187,922
Downloads: 31

Depended by

RankDownloadsName
19,37783,556prick
21,56370,557shellopts
58,66017,864pg_graph
81,37411,090fixture_fox
83,40810,676modular_tree
83,84910,575qrpm
86,06010,114postspec
175,9162,065sqlsnip
182,636857dumps

Depends on

RankDownloadsName
99428,731,506simplecov

Owners

#GravatarHandle
1iconclrgem