Categories
General nonsense Ruby

Duck typing for dummies

def duck?
  respond_to? :quack
end

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.