module Contracts
rdoc This module contains all the builtin contracts. If you want to use them, first:
import Contracts
And then use these or write your own!
A simple example:
Contract Num, Num => Num def add(a, b) a + b end
The contract is Contract Num, Num, Num
. That says that the
add
function takes two numbers and returns a number.
Constants
- VERSION
Public Class Methods
extended(base)
click to toggle source
# File lib/contracts.rb, line 19 def self.extended(base) base.send(:extend, Core) end
included(base)
click to toggle source
# File lib/contracts.rb, line 15 def self.included(base) base.send(:include, Core) end