Module: Contracts::Builtin

Included in:
Contracts
Defined in:
lib/contracts/builtin_contracts.rb

Defined Under Namespace

Classes: And, Any, Args, Bool, CallableClass, CollectionOf, DescendantOf, Enum, Eq, Exactly, Func, HashOf, Int, KeywordArgs, Maybe, Nat, NatPos, Neg, None, Not, Num, Optional, Or, Pos, RangeOf, RespondTo, Send, StrictHash, Xor

Constant Summary collapse

ArrayOf =

Takes a contract. The related argument must be an array. Checks the contract against every element of the array. If it passes for all elements, the contract passes. Example: ArrayOf[Num]

CollectionOf::Factory.new(Array)
SetOf =

Takes a contract. The related argument must be a set. Checks the contract against every element of the set. If it passes for all elements, the contract passes. Example: SetOf[Num]

CollectionOf::Factory.new(Set)