class Soybean::Generators::MappingGenerator::MethodDefCreator

Private Instance Methods

dump_method(mdef) click to toggle source
# File lib/soybean/generators/mapping_generator.rb, line 125
        def dump_method(mdef)
          style = mdef.style
          inputuse = mdef.inputuse
          outputuse = mdef.outputuse
          paramstr = param2str(mdef.parameters)
          if paramstr.empty?
            paramstr = '[]'
          else
            paramstr = "[ " << paramstr.split(/\r?\n/).join("\n    ") << " ]"
          end
          definitions = <<__EOD__
#{ndq(mdef.soapaction)},
  #{dq(mdef.name).underscore},
  #{paramstr},
  { :request_style =>  #{nsym(style)}, :request_use =>  #{nsym(inputuse)},
    :response_style => #{nsym(style)}, :response_use => #{nsym(outputuse)},
    :faults => #{mdef.faults.inspect} }
__EOD__
          if style == :rpc
            assign_const(mdef.qname.namespace, 'Ns')
            return <<__EOD__
[ #{dqname(mdef.qname)},
  #{definitions}]
__EOD__
          else
            return <<__EOD__
[ #{definitions}]
__EOD__
          end
        end