Won't pass me?


#1

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

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

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

Won't pass me???


13. Imitating Multiple Inheritance
#2

I'm trying to figure out what but this worked:

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



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


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

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.