Ruby - Modules and Mixins
Which of the following is the correct syntax to include a module named
Greetings inside a class Person?Greetings inside a class Person?include ModuleName inside the class body without parentheses.include Greetings correctly. class Person; extend Greetings; end uses extend which adds class methods, not instance methods. class Person; include(Greetings); end uses parentheses which is not standard syntax. class Person; use Greetings; end uses use which is invalid in Ruby.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions