Class: Contracts::Func

Inherits:
CallableClass show all
Defined in:
lib/contracts/builtin_contracts.rb

Overview

Used to define contracts on functions passed in as arguments. Example: Func[Num => Num] # the function should take a number and return a number

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CallableClass

[]

Constructor Details

#initialize(*contracts) ⇒ Func

Returns a new instance of Func.


361
362
363
# File 'lib/contracts/builtin_contracts.rb', line 361

def initialize(*contracts)
  @contracts = contracts
end

Instance Attribute Details

#contractsObject (readonly)

Returns the value of attribute contracts.


360
361
362
# File 'lib/contracts/builtin_contracts.rb', line 360

def contracts
  @contracts
end