Posted By: Brian Takita
Date: 2005-09-04 05:22
Summary: Duck Type Checker 0.1.0 Released
Project: Duck Type Checker
Duck Type Checker is a simple module that makes it easier for you to check the method signature of an object.
Checking an object is as simple as;
require 'ducktypechecker'
o = 1
# This will cause a TypeError to be raised
DuckType.check(o, :blah)
# You can also customize your responses to missing methods
DuckType.check(o, [:blah, :bling]) do |s|
raise "Method #{s.to_s} needs to be implemented,"
end
# To install use 'gem install ducktypechecker' |
|