Last active
December 10, 2015 12:08
-
-
Save bachue/4431884 to your computer and use it in GitHub Desktop.
You can't include a class description in a method, it causes SyntaxError. But you can require a file with a class description in a method, please check https://gist.github.com/4431893
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f | |
class C | |
def g | |
'hello world' | |
end | |
end | |
puts C.new.g | |
end | |
f # => SyntaxError, class definition in method body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment