Module: Dux::HacksLikeADuck

Defined in:
lib/dux/hacks_like_a_duck.rb

Overview

Experimental module to grant unary ~ to symbols or strings for duck-checking

Instance Method Summary collapse

Instance Method Details

#~Proc

Transform into a proc that asks its argument if it responds to self

Returns:

  • (Proc)


8
9
10
# File 'lib/dux/hacks_like_a_duck.rb', line 8

def ~
  duckify
end