Posted By: Brian Takita
Date: 2005-09-07 06:42
Summary: Duck Type Checker 0.1.1 Released
Project: Duck Type Checker
DuckTypeChecker is a module that checks to see if an objects conforms to a Duck Type.
This version features improvements in the documentation.
Here is an example the DuckTypeChecker module:
require 'ducktypechecker'
s = Struct.new(:a)
o = s.new(1)
DuckType.check(o, [:a, :b], 'o')
# TypeError - "Variable 'o' needs to implement 'b'." |
|