Skip to content

Instantly share code, notes, and snippets.

@ptzn
Created March 18, 2011 21:42
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 ptzn/876897 to your computer and use it in GitHub Desktop.
Save ptzn/876897 to your computer and use it in GitHub Desktop.
def gimme_class
class MethodClass
def where_am_i?
puts "in method!"
end
end
obj = MethodClass.new
obj.where_am_i?
end
# SyntaxError: compile error
# (irb):2: class definition in method body
# from (irb):10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment