How do I define a method on one line in Ruby? December 29, 2022 by Tarik You can avoid the need to use semicolons if you use parentheses: def hello() :hello end