Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/trunk/lib/soap/rpc/methodDef.rb

Revision 2005, 1.5 kB (checked in by nahi, 1 year ago)
  • introduce SOAP::RPC::MethodDef? and use it instead of complex Array structure.
  • param type 'in', 'out', 'retval' -> :in, :out, :retval
Line 
1 # SOAP4R - A method definition
2 # Copyright (C) 2000-2007  NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
3
4 # This program is copyrighted free software by NAKAMURA, Hiroshi.  You can
5 # redistribute it and/or modify it under the same terms of Ruby's license;
6 # either the dual license version in 2003, or any later version.
7
8
9 module SOAP
10 module RPC
11
12
13 class MethodDef
14   attr_reader :name
15   attr_reader :soapaction
16   attr_reader :qname
17   attr_accessor :style
18   attr_accessor :inputuse
19   attr_accessor :outputuse
20   attr_reader :parameters
21   attr_reader :faults
22
23   def initialize(name, soapaction, qname)
24     @name = name
25     @soapaction = soapaction
26     @qname = qname
27     @style = @inputuse = @outputuse = nil
28     @parameters = []
29     @faults = {}
30   end
31
32   def add_parameter(io_type, name, qname, mapped_class)
33     @parameters << Parameter.new(io_type, name, qname, mapped_class)
34   end
35
36   def self.to_param(param)
37     if param.respond_to?(:io_type)
38       param
39     else
40       io_type, name, param_type = param
41       mapped_class_str, nsdef, namedef = param_type
42       if nsdef && namedef
43         qname = XSD::QName.new(nsdef, namedef)
44       else
45         qname = nil
46       end
47       MethodDef::Parameter.new(io_type.to_sym, name, qname, mapped_class_str)
48     end
49   end
50
51   class Parameter
52     attr_reader :io_type
53     attr_reader :name
54     attr_reader :qname
55     attr_reader :mapped_class
56
57     def initialize(io_type, name, qname, mapped_class)
58       @io_type = io_type
59       @name = name
60       @qname = qname
61       @mapped_class = mapped_class
62     end
63   end
64 end
65
66
67 end
68 end
Note: See TracBrowser for help on using the browser.