Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/teamdrive_api/core_ext/array.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#symbolize_keys ⇒ Object
Returns an Array with all elements’ keys converted to symbols, as long as they respond to
symbolize_keys
. -
#symbolize_keys! ⇒ Object
Converts the keys of all elements to symbols, as long as the elements respond to
symbolize_keys!
.
Instance Method Details
#symbolize_keys ⇒ Object
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 |