Skip to content

Instantly share code, notes, and snippets.

@mykecameron
Created October 1, 2010 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mykecameron/606816 to your computer and use it in GitHub Desktop.
Save mykecameron/606816 to your computer and use it in GitHub Desktop.
class Test
def can_foo?
respond_to?(:foo)
end
private
def foo;end
end
Test.new.can_foo?
#=> false
Test.new.respond_to?(:foo,true)
#=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment