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

Version Path
facets-2.9.3 lib/core/facets/kernel/instance_assign.rb
facets-2.9.2 lib/core/facets/kernel/instance_assign.rb
facets-2.9.2 src/core/facets/kernel/instance_assign.rb
facets-2.9.1 lib/core/facets/kernel/instance_assign.rb
facets-2.9.0 lib/core/facets/kernel/instance_assign.rb
facets-2.9.0.pre.2 lib/core/facets/kernel/instance_assign.rb
facets-2.9.0.pre.1 lib/core/facets/kernel/instance_assign.rb
facets-2.8.4 lib/core/facets/kernel/instance_assign.rb
facets-2.8.3 lib/core/facets/kernel/instance_assign.rb