contracts.ruby brings code contracts to the Ruby language.
Example:
class Example
include Contracts::Core
C = Contracts
Contract C::Num, C::Num => C::Num
def add(a, b)
a + b
end
end
This documentation is open source. If you find it incomplete or confusing, please submit an issue, or, better yet, a pull request.