Skip to content

Instantly share code, notes, and snippets.

@djberg96
Created December 25, 2011 14:56
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 djberg96/1519378 to your computer and use it in GitHub Desktop.
Save djberg96/1519378 to your computer and use it in GitHub Desktop.
Confused about respond_to and singleton methods
class Foo
class << self
def bar; end
# Result is 'NOPE' - why?
if respond_to?(:bar)
puts "YEP"
else
puts "NOPE"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment