From: Joe Van Dyk Date: 2005-08-02T06:52:48+09:00 Subject: module / inheritance question class Parent def foo puts "Parent::foo called" end end module TheModule def self.boo foo end end class Child < Parent include TheModule def initialize super end def boo TheModule.boo end end Child.new.boo # Two questions: # 1) Why do I need Child.boo? Shouldn't function TheModule.boo be mixed in # to Child? # # 2) Any way I can get TheModule.boo to call Parent.foo? # # # What I'm really trying to do is something like this: module MenuBarUtils def create_menu title # Creates a Gtk::Menu and then calls #append, a function that's in # Gtk::MenuBar. end def add_menu_item menu, title, &action # create menu item, attach it to menu, and bind &action to it end end class MyMenuBar < Gtk::MenuBar include MenuBarUtils def initialize super file_menu = create_menu "File" add_menu_item(file_menu, "Quit") { exit } end end