Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/teamdrive_api/core_ext/array.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#symbolize_keysObject

Returns an Array with all elements’ keys converted to symbols, as long as they respond to symbolize_keys.



4
5
6
# File 'lib/teamdrive_api/core_ext/array.rb', line 4

def symbolize_keys
  map { |e| e.respond_to?(:symbolize_keys) ? e.symbolize_keys : e }
end

#symbolize_keys!Object

Converts the keys of all elements to symbols, as long as the elements respond to symbolize_keys!



10
11
12
13
14
# File 'lib/teamdrive_api/core_ext/array.rb', line 10

def symbolize_keys!
  each do |e|
    e.symbolize_keys! if e.respond_to?(:symbolize_keys!)
  end
end