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: 45,281 of 180,661
Downloads: 21,942

Daily

Ranking: 16,801 of 180,641
Downloads: 22

Depended by

RankDownloadsName
23,55552,424shellopts
23,81851,669prick
71,54011,669pg_graph
99,9666,918modular_tree
101,0716,765qrpm
121,6694,652fixture_fox
135,7103,856postspec
178,606437dumps

Depends on

RankDownloadsName
101314,244,003simplecov

Owners

#GravatarHandle
1iconclrgem