From: "David A. Black" Date: 2009-09-17T05:59:06+09:00 Subject: Re: block issues... Hi -- On Thu, 17 Sep 2009, Dylan Lukes wrote: > In the following block, each plugin in the constant hash PLUGINS is > supposed to take two parameters, server and config. The only problem > here is that: > > rmss.rb:175:in `start_plugins': undefined method `plugin' for > main:Object (NoMethodError) > > def start_plugins(server) > plugins = [] > PLUGINS.each { |plugin| > if CONFIG.has_key?(plugin.IDENTIFIER) > plugins.append(plugin(server, CONFIG[plugin.IDENTIFIER])) > end > } > end > > > > > Does anyone have any solution for this? > > The idea is to load a list of plugins from the PLUGINS and CONFIG hashes > into an array, with their matching configuration, and then run them all. > The latter part is not included in this code, as is also the case for > when there is no configuration, which has also not been added. If PLUGINS is a hash, then you probably want to do something like: PLUGINS.each {|key, value| ... } But the main problem is that you're using a variable name as a method name, and apparently there's no such method. So the solution will depend on exactly what method you're really trying to run. What exactly is in the hash? David -- David A. Black, Director Ruby Power and Light, LLC (http://www.rubypal.com) Ruby/Rails training, consulting, mentoring, code review Book: The Well-Grounded Rubyist (http://www.manning.com/black2)