Q. What is the primary difference between module_function and extend self in Ruby?

  • (A) module_function makes the specified methods accessible as module methods, while extend self makes them accessible as instance methods
  • (B) module_function makes the specified methods private, while extend self makes them public
  • (C) module_function creates a new module, while extend self extends the current module
  • (D) module_function makes the specified methods singleton methods, while extend self makes them instance methods
πŸ’¬ Discuss
βœ… Correct Answer: (A) module_function makes the specified methods accessible as module methods, while extend self makes them accessible as instance methods

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
195
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
88%
Success Rate