Skip to content

Instantly share code, notes, and snippets.

@zobar
Created August 30, 2015 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zobar/f43cc5fca42d2e0ae6c7 to your computer and use it in GitHub Desktop.
Save zobar/f43cc5fca42d2e0ae6c7 to your computer and use it in GitHub Desktop.
Nested function definitions are a bad idea in Ruby.
#!/usr/bin/env ruby -w
def defit
def ohai
puts "hello from #{self.class.inspect} #{self.inspect}"
end
puts "called defit in #{self.class.inspect} #{self.inspect}"
end
module MyModule
defit
end
:whatever.ohai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment