Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/kojo/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#args_to_hashObject

Convert an array of [“key=value”, “key=value”] pairs to a hash



5
6
7
8
9
10
# File 'lib/kojo/extensions/array.rb', line 5

def args_to_hash
  collect { |a| k, v = a.split '=' }
    .to_h
    .symbolize_keys
    .typecast_values
end