public
Description: Ruby WDDX gem.
Homepage: http://code.juretta.com/ruby/wddx/
Clone URL: git://github.com/juretta/wddx.git
Search Repo:
sort instance variables to get predictable output. instance_variables 
behaviour changes from 1.8 to 1.9 as well, it returns an array of symbols 
in 1.9 instead an array of strings.
juretta (author)
Wed Apr 30 16:34:45 -0700 2008
commit  71ab0ae8df044e558cc923b2479de0ee73c9d2fc
tree    5eda7a81a6a74b71002aaf9691d88d74865ed2e0
parent  c22c1a5cd1b500f96a52736fa2e061ee18ce6a4d
...
96
97
98
99
 
100
101
102
...
96
97
98
 
99
100
101
102
0
@@ -96,7 +96,7 @@
0
         end
0
       end
0
     else
0
- self.instance_variables.collect {|var| hash[var.gsub(/@/, "")] = instance_variable_get(var)}
0
+ hash = self.instance_variables.sort.inject({}) {|h, var| h[var.to_s.gsub(/@/, "")] = instance_variable_get(var); h}
0
     end
0
     hash.wddx_serialize
0
   end

Comments

    No one has commented yet.