Class: Array

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

Instance Method Summary collapse

Instance Method Details

#to_options_hashObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/social_engine/core_ext/array.rb', line 2

def to_options_hash
  hash = {}
  self.each do |element|
    if element.is_a? Symbol
      hash[element] = {}
    elsif element.is_a? Hash
      hash[element.keys[0]] = element.values[0]
    end
  end
  hash
end