Ruby - Modules and Mixins
Which of the following is the correct way to include a module
Flyable into a class Bird in Ruby?Flyable into a class Bird in Ruby?include ModuleName.include Flyable, which is correct. class Bird; inherits Flyable; end uses inherits which is invalid syntax. class Bird; extend Flyable; end uses extend, which adds methods as class methods, not instance methods. class Bird; use Flyable; end uses use, which is not Ruby syntax.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions