Thanks for the idea. I am first going to try the dynamic class method.
I changed your concept to better match my needs, but am having some
general Ruby problems. This is off topic for HTTParty, but in case
you're interested, here's the code I am struggling with. I'll work on
it some more next week to see if I can get beyond the error "wrong
constant name TestModule::Thread1Requestor (NameError)"
Thanks,
--Bob
module TestModule
class Thread1Requestor
def worker
include HTTParty
http = HTTParty
puts "#### http id: #{http.object_id}"
end
end
class Thread2Requestor
def worker
include HTTParty
http = HTTParty
puts "#### http id: #{http.object_id}"
end
end
class ThreadTester
def run
threads = Array.new(2)
for i in (1..2)
threads[i] = Thread.new do
puts "#### thread " + i.to_s
obj = Object.const_get("TestModule::Thread#{i}
Requestor").new
obj.worker
end
threads[i].join
end
end
end
end
tester = TestModule::ThreadTester.new
tester.run