Sha256: 58908d6d766590ce1f272d75c19a13d692d4017a4f1d0ec2fd5a22b9b1f9e198

Contents?: true

Size: 423 Bytes

Versions: 43

Compression:

Stored size: 423 Bytes

Contents

# require "eitil_core/argument_helpers/args_to_h_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 args_to_h!(*local_vars)

    local_vars.reject { |lvar| lvar.to_s.starts_with?('_') }
              .map    { |lvar| { "#{lvar}": binding.of_caller(2).local_variable_get(lvar) } }
              .inject &:merge

  end

end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
eitil-1.1.19 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.18 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.17 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.16 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.15 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.14 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.13 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.12 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.11 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.10 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.9 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.8 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.7 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.6 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.5 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.4 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.3 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.2 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.1 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb
eitil-1.1.0 eitil_core/lib/eitil_core/argument_helpers/args_to_h_bang.rb