From 361dcad8fd022065bc38fd557b0ec02d6e3f1a0b Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Tue, 5 Apr 2005 05:39:45 +0000 Subject: be explicit about the object to do #instance_eval in for delegated dispatching, clean up iterations to use #zip (bitsweat), git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/action_web_service/support/signature_types.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'actionwebservice/lib/action_web_service/support') diff --git a/actionwebservice/lib/action_web_service/support/signature_types.rb b/actionwebservice/lib/action_web_service/support/signature_types.rb index 5c57254bc3..a7ee2fc773 100644 --- a/actionwebservice/lib/action_web_service/support/signature_types.rb +++ b/actionwebservice/lib/action_web_service/support/signature_types.rb @@ -9,12 +9,9 @@ module ActionWebService # :nodoc: def canonical_signature_entry(spec, i) name = "param#{i}" if spec.is_a?(Hash) - name = spec.keys.first - spec = spec.values.first - type = spec - else - type = spec + name, spec = spec.keys.first, spec.values.first end + type = spec if spec.is_a?(Array) ArrayType.new(canonical_signature_entry(spec[0], 0), name) else @@ -173,7 +170,7 @@ module ActionWebService # :nodoc: yield name, type end elsif @type_class.respond_to?(:columns) - i = 0 + i = -1 @type_class.columns.each do |column| yield column.name, canonical_signature_entry(column.klass, i += 1) end -- cgit v1.2.3