Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/kojo/extensions/array.rb
Instance Method Summary collapse
-
#args_to_hash ⇒ Object
Convert an array of [“key=value”, “key=value”] pairs to a hash.
Instance Method Details
#args_to_hash ⇒ Object
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 |