diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-03-29 12:31:39 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-03-29 12:31:39 +0000 |
commit | b94bd32f3116b469b48400382dbc964bf17994d1 (patch) | |
tree | 91752d7e0f49916e5ed2b9e015815c6dc06b4366 /actionwebservice/lib/action_web_service/api | |
parent | 715715aed443a027fccbac995cd5404eaeabaf53 (diff) | |
download | rails-b94bd32f3116b469b48400382dbc964bf17994d1.tar.gz rails-b94bd32f3116b469b48400382dbc964bf17994d1.tar.bz2 rails-b94bd32f3116b469b48400382dbc964bf17994d1.zip |
first pass of web service scaffolding. add ability to quickly generate an
action pack request for a protocol, add missing log_error when we fail to parse
protocol messages. add RDoc for scaffolding and functional testing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1037 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/api')
-rw-r--r-- | actionwebservice/lib/action_web_service/api/base.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionwebservice/lib/action_web_service/api/base.rb b/actionwebservice/lib/action_web_service/api/base.rb index e440a8b1bd..03e406cfc3 100644 --- a/actionwebservice/lib/action_web_service/api/base.rb +++ b/actionwebservice/lib/action_web_service/api/base.rb @@ -284,10 +284,31 @@ module ActionWebService # :nodoc: marshaler.cast_inbound_recursive(return_value, @returns[0]) end + # String representation of this method + def to_s + fqn = "" + fqn << (@returns ? (friendly_param(@returns[0], nil) + " ") : "void ") + fqn << "#{@public_name}(" + if @expects + i = 0 + fqn << @expects.map{ |p| friendly_param(p, i+= 1) }.join(", ") + end + fqn << ")" + fqn + end + private def response_name(encoder) encoder.is_a?(WS::Encoding::SoapRpcEncoding) ? (@public_name + "Response") : @public_name end + + def friendly_param(spec, i) + name = param_name(spec, i) + type = param_type(spec) + spec = spec.values.first if spec.is_a?(Hash) + type = spec.is_a?(Array) ? (type.to_s + "[]") : type.to_s + i ? (type + " " + name) : type + end end end end |