hy a ask if i can do this:
i should start the set funktions of the Parts, but you can leave Parts out.
Code:
module Addon
Parts=[]
def self.set(item)
Parts.each { |name| send(name).set(item) if send(name).respond_to?(:set) }
end
end
module Addon
Parts << "A"
module A
def self.set(item)
#do
end
end
end
module Addon
Parts << "B"
module B
def self.set(item)
#do
end
end
end
module Addon
Parts << "C"
module C
def self.set(item)
#do
end
end
end
i should start the set funktions of the Parts, but you can leave Parts out.