Sha256: 3f6eaafedd7a1bfbda9e224b35f57d4990edc4d0b13eef849fe290d4783002d8

Contents?: true

Size: 482 Bytes

Versions: 139

Compression:

Stored size: 482 Bytes

Contents

module Rake
  # ##########################################################################
  # Mixin for creating easily cloned objects.
  #
  module Cloneable
    # The hook that invoked by 'clone' and 'dup' methods.
    def initialize_copy(source)
      super
      source.instance_variables.each do |var|
        src_value  = source.instance_variable_get(var)
        value = src_value.clone rescue src_value
        instance_variable_set(var, value)
      end
    end
  end
end

Version data entries

139 entries across 121 versions & 33 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/cloneable.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/cloneable.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/cloneable.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rake-10.0.3/lib/rake/cloneable.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/cloneable.rb
sadui-0.0.4 vendor/bundle/ruby/2.1.0/gems/rake-10.1.1/lib/rake/cloneable.rb
sadui-0.0.4 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/cloneable.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/cloneable.rb
plyom_user-0.3.1 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
plyom_user-0.3.0 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
plyom_user-0.2.9 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
plyom_user-0.2.8 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/cloneable.rb
vtd_xml-0.0.3-java bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/cloneable.rb
plyom_user-0.2.7 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
plyom_user-0.2.6 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
plyom_user-0.2.5 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/cloneable.rb
plyom_user-0.2.4 vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/cloneable.rb