Sha256: 994d8a875e61bb1a789ffd6155ea76b0608f10231361a6bc6ddd080e452ad0ad

Contents?: true

Size: 393 Bytes

Versions: 72

Compression:

Stored size: 393 Bytes

Contents

# require "eitil_core/argument_helpers/all_kwargs_to_ivars_bang"

require "eitil_core/lookups/gem_path"
require "#{Find.gem_path('binding_of_caller')}/lib/binding_of_caller/mri.rb"

Kernel.module_eval do

  def all_kwargs_to_ivars!(namespace=:kwargs)
    binding.of_caller(1).local_variable_get(namespace).each do |name, value|
      instance_variable_set "@#{name}", value
    end
  end

end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
eitil-2.0.8 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.7 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.6 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.5 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.4 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.3 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.2 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.1 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-2.0.0 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.4.1 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.4.0 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.12 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.11 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.10 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.9 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.8 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.7 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.6 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.5 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb
eitil-1.3.4 eitil_core/lib/eitil_core/argument_helpers/all_kwargs_to_ivars_bang.rb