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,148 of 188,779
Downloads: 29,211

Daily

Ranking: 55,176 of 188,757
Downloads: 1

Depended by

RankDownloadsName
19,10587,132prick
21,36172,994shellopts
57,65018,530pg_graph
79,39811,678fixture_fox
82,44111,034modular_tree
82,72610,972qrpm
82,90310,932postspec
174,8192,245sqlsnip
183,421907dumps

Depends on

RankDownloadsName
99437,166,465simplecov

Owners

#GravatarHandle
1iconclrgem