Sha256: a9d50d5bc5cff36efa39718bdb1a494962804632e9c43efd180da11b7e66a027

Contents?: true

Size: 364 Bytes

Versions: 43

Compression:

Stored size: 364 Bytes

Contents

# require "eitil_core/argument_helpers/args_to_h"

Kernel.module_eval do

  def args_to_h(local_binding, *local_vars)

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

  end

end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
eitil-1.1.39 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.38 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.37 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.36 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.35 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.34 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.33 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.32 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.31 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.30 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.29 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.28 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.27 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.26 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.25 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.24 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.23 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.22 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.21 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb
eitil-1.1.20 eitil_core/lib/eitil_core/argument_helpers/args_to_h.rb