title: Ruby mixin - multiple inheritance
body: <p>I have recently learned how to implement inheritance through modules. However, I cannot see clean solution if I wanted to implement multiple inheritance.
  Here's the original example that uses single inheritance and calls initialize methods of superclasses.:</p>
  
  <pre><code>module ModuleB  
    def initialize
      puts "initialize from ModuleB"
      @b = 5
    end
  end
  
  module ModuleA
    include ModuleB
  
    def initialize
      super
      puts "initialize from ModuleA"
      @a = @b
    end
  
    def action_1
      @a = @b + 1
    end
  end
  
  class ClassA
    include ModuleA
    def initialize
      super
      puts 'initialize - method in ClassA'
      @c = @a
      @d = @b
      puts "a = #@a"
      puts "b = #@b"
      puts "c = #@c"
      puts "d = #@d"
    end
  
  end
  
  instA = ClassA.new
  puts instA.action_1
  </code></pre>
  
  <p>However, if there was additional ModuleC included in ClassA, how would we invoke "superclasses" initialize mehods?</p>
  
  <pre><code>    module ModuleB  
        def initialize
          puts "initialize from ModuleB"
          @b = 5
        end
      end
  
      module ModuleA
        include ModuleB
  
        def initialize
          super
          puts "initialize from ModuleA"
          @a = @b
        end
  
        def action_1
          @a = @b+1
          @a = @b + 1
        end
      end
  
      module ModuleC
        include ModuleB
  
        def initialize
          super
          puts "initialize from ModuleC"
          @a = 'cute Zuzia'
        end
  
        def action_1
          @a = 'something'
        end
      end
  
  
      class ClassA
        include ModuleA
        include ModuleC
        def initialize
          super  # which initialize will be called? From moduleA or from moduleC?
                  # what if I wanted to invoke ModuleC initialize from classA instance as well?
          puts 'initialize - method in ClassA'
          @c = @a
          @d = @b
          puts "a = #@a"
          puts "b = #@b"
          puts "c = #@c"
          puts "d = #@d"
        end
  
      end
  </code></pre>
  
  <p>How to enable multiple inheritance with mixin in that case?</p>