On Oct 26, 11:32 ¨Βν¬ Μεσμιε ΦιμκοεΌμεσμιεφιμκ®®®ΐηναιμ®γονχςοτεΊ

> 1. Is this functionality already tucked away somewhere else?
> 2. How can I get rid of those nasty evals?

Facets has #instance_assign, however the library is transitioning to
the more flexible instance_vars.update().

What I usually do of this kind of thing is use setter methods. That
way you can control what comes in, how it comes in, and bonus! it's
well documented. Eg. Along the lines of:

         DEFAULTS = {
           :select_max => 10000,
           :select_try => 1000,
           :min_sleep_sec => 5,
           :max_sleep_sec => 1800,
           :default_sleep => 10
         }

         def initialize(opts = {})
           DEFAULTS.merge(opts).each do |k,v|
             send("#{k}=", v)
           end
         end

         # document me

         attr_accessor :select_max

         # or, if you need more control

         def select_max=(val)
           @select_max = val
         end

         # etc...

T.