Module: HashExtensions

Included in:
Hash
Defined in:
lib/benchmark_time/hash_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_instance_variables(bind, opts = {}) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/benchmark_time/hash_extensions.rb', line 2

def to_instance_variables(bind, opts={})
  each do |key, val|
    bind.eval("@#{key}=#{val.inspect}")
    # we can build attr_accessor, attr_reader, attr_writers off these options
   # bind.eval "self.class.class_eval 'attr_reader :foo'"if opts[:define]
  end
end