What is the correct way to define a method in Ruby?
A. def method_name(parameters) code end
B. function method_name(parameters) code
C. method method_name(parameters) = code
D. method_name(parameters) -> code
Answer: Option A
Related Questions on Basic Syntax in Ruby
What does the 'puts' method do in Ruby?
A. Prints to console
B. Converts to string
C. Finds the length
D. Reads input from user

Join The Discussion