L
Luke Worth
Hi. Coming from a c++/java background, i'm having a bit of trouble in
deciding how to split up source code. I currently have this:
#----program_tree.rb
require 'gtk2'
require 'program_tree_populate'
module HSGui
# GtkTreeStore is the generic GtkTreeModel implementation
class ProgramTree < Gtk::TreeStore
def initialize(source_code)
super(String)
populate(source_code)
end
end
end
#----program_tree_populate.rb
require 'gtk2'
module HSGui
class ProgramTree < Gtk::TreeStore
def populate(source_code)
#etc...
end
end
end
This seems slightly dodgy to me... Would anyone do this some other way?
(like define in a module then include the module)
deciding how to split up source code. I currently have this:
#----program_tree.rb
require 'gtk2'
require 'program_tree_populate'
module HSGui
# GtkTreeStore is the generic GtkTreeModel implementation
class ProgramTree < Gtk::TreeStore
def initialize(source_code)
super(String)
populate(source_code)
end
end
end
#----program_tree_populate.rb
require 'gtk2'
module HSGui
class ProgramTree < Gtk::TreeStore
def populate(source_code)
#etc...
end
end
end
This seems slightly dodgy to me... Would anyone do this some other way?
(like define in a module then include the module)