# File lib/rubytter.rb, line 177 def self.json_to_struct(json) case json when Array json.map{|i| json_to_struct(i)} when Hash struct_values = {} json.each do |k, v| case k when String, Symbol struct_values[k.to_sym] = json_to_struct(v) end end unless struct_values.empty? get_struct(struct_values.keys).new(*struct_values.values) else nil end else case json when String CGI.unescapeHTML(json) else json end end end