Sha256: 1c496f06bb1ab7b008730dea7f22a2136e196fef8e3eafc384f489c6db749ea9
Contents?: true
Size: 355 Bytes
Versions: 9
Compression:
Stored size: 355 Bytes
Contents
module Kernel # Set instance variables using a hash. # # instance_assign('@a'=>1, '@b'=>2) # @a #=> 1 # @b #=> 2 # # DEPRECATE: Use instance.update instead of #instance_assign. def instance_assign(hash) hash.each do |k,v| k = "@#{k}" if k !~ /^@/ instance_variable_set(k, v) end return self end end
Version data entries
9 entries across 8 versions & 1 rubygems