Method: CouchObject::Utils.decode_strings

Defined in:
lib/couch_object/utils.rb

.decode_strings(input) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/couch_object/utils.rb', line 23

def self.decode_strings(input)
  case input.class.to_s
  when "String"
    # HTMLEntities.decode_entities(input).toutf8
    input.toutf8
  when "Array"
    input.map! do |n|
      decode_strings(n)
    end
  when "Hash"
    input.each_pair do |key, value|
      input[key] = decode_strings(value)
    end
  else
    input
  end
end