Method: CodeWeb::MethodCall#sorted_hash

Defined in:
lib/code_web/method_call.rb

#sorted_hash(args) ⇒ Object



60
61
62
63
64
65
66
67
68
69
# File 'lib/code_web/method_call.rb', line 60

def sorted_hash(args)
  case args
  when Hash
    args.each_pair.sort_by {|n,v| n }.inject({}) {|h, (n,v)| h[n]=sorted_hash(v); h}
  when Array
    args
  else
    args
  end
end