tomstuart/monads — pull request #2 by roryokane (2014-10-07 06:52:02+00:00)
Title: Implement `respond_to?` in module Monad

Prompted by your statement

> If this was production code, we should remember to implement [`#respond_to?`](http://rubydoc.info/stdlib/core/Object#respond_to%3F-instance_method) as well.

at [codon.com – Refactoring Ruby with Monads](http://codon.com/refactoring-ruby-with-monads).

I implemented `respond_to?` by implementing `respond_to_missing?`, as recommended by [thoughtbot – Always Define `respond_to_missing?` When Overriding `method_missing`](http://robots.thoughtbot.com/always-define-respond-to-missing-when-overriding), so that `method` also works. This requires Ruby 1.9 and later.