Imitating Multiple Inheritance


#1


#2

any idea wats wrong...


#3


#4

Let me peer into my crystal ball. Which is as much as I will do with these pictures. Can't see or replicate; can't help. Post the code, please. Thank you.


#5

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

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

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


#6

Now punctuate

Before and after code samples, three back-ticks,

```

#9

i did but still shows same error...


#10

We can't fix it until you post the code. You had it there until you removed it.


#11

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


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

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

#12

module deserves an end as well.


#13

i did try tat but it shows this error wen i end the module..

Oops, try again. Your code doesn't look quite right. Feel free to peek back at the previous exercise if you need help!


#14

The include directives are siblings of the def's so should have the same indentation.


#15


#16

it worked.... that solved it....! :relaxed:


#17

My code was correct the whole time but I had to refresh the page for it to work, FYI.


#19