Open jgonera opened 13 years ago
I'm using this patch:
# used to transform Structs from Dropbox to JSON
class Struct
def to_map
map = Hash.new
self.members.each { |m| map[m] = self[m] }
map
end
def to_json(*a)
to_map.to_json(*a)
end
end
I'm doing something similar but still, it bothers me that there is a hash -> struct -> hash conversion.
What is the reason behind converting all the data to structs? I actually find hashes better because I can encode them back to JSON easily. How about an option for API calls (or some general configuration setting) which would disable the hash to struct conversion?