Lesson 13 Pl help what more is to be added in the code below


#1

Below is the code as per instruction . The remark in the Editor says whether you have created MartialArts as module.

module MartialArts
 def swordsman
     puts "I'm a swordsman."
 end



include MartialArts
class Ninja

  def initialize(clan)
    @clan = clan
  end
end
incude MartialArts
class Samurai

  def initialize(shogun)
    @shogun = shogun
  end
end

#2

Hi Rajesh,

You have two problems:

  1. You have to include inside the class definitions.
  2. You forgot to end your module definition.

#3

To clarify about ending your module definition, you need to end the definition and end the module.


#4

module MaritialArts
def swordsman
puts "I'm a swordsman. "
end
end

class Ninja
include MaritialArts
def initialize(clan)
@clan = clan
end
end

class Samurai
include MaritialArts
def initialize(shogun)
@shogun = shogun
end
end

What is wrong in this code?
i gets error like "Did you create a module called MartialArts?"


#5

Mine did the same thing. Refresh your page and hit submit again. Worked for me.


#6

Im sure its been noticed/realized by now but the "MaritialArts" module, while consistent through your Methods, will not meet the sites passing conditions of "Martial"