how to define a class in only one line?
I tried
class X begin end
and
开发者_JAVA百科class X {}
neight correct. What is the right code?
You need a semicolon after class X
:
class X; end
correct and verified example:
class C; end
and another, tricky solution :)
C = Class.new
精彩评论