Method: WebappWorker::System#initialize
- Defined in:
- lib/webapp_worker/system.rb
#initialize(user_supplied_hash = {}) ⇒ System
Returns a new instance of System.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/webapp_worker/system.rb', line 10 def initialize(user_supplied_hash={}) standard_hash = { user:"nobody", tmp_dir:"/tmp/webapp_worker/", pid_file:"/tmp/webapp_worker/waw.pid", ipc_file:"/tmp/webapp_worker/waw", logger:"" } user_supplied_hash = {} unless user_supplied_hash user_supplied_hash = standard_hash.merge(user_supplied_hash) user_supplied_hash.each do |key,value| self.instance_variable_set("@#{key}", value) self.class.send(:define_method, key, proc{self.instance_variable_get("@#{key}")}) self.class.send(:define_method, "#{key}=", proc{|x| self.instance_variable_set("@#{key}", x)}) end end |