Sha256: 80912c56b3fadab09d12810a70ac54c96d8e2f00a1634aaea551cd24b334222c

Contents?: true

Size: 1.29 KB

Versions: 23

Compression:

Stored size: 1.29 KB

Contents

# encoding: ASCII-8BIT
# WSDL4R - Class name creator.
# Copyright (C) 2000-2007  NAKAMURA, Hiroshi <nahi@ruby-lang.org>.

# This program is copyrighted free software by NAKAMURA, Hiroshi.  You can
# redistribute it and/or modify it under the same terms of Ruby's license;
# either the dual license version in 2003, or any later version.


require 'soap/mapping/type_map'
require 'xsd/codegen/gensupport'


module WSDL
module SOAP


class ClassNameCreator
  include XSD::CodeGen::GenSupport

  def initialize
    @classname = {}
  end

  def assign_name(qname, modulepath = nil)
    key = [modulepath, qname]
    unless @classname.key?(key)
      if klass = ::SOAP::TypeMap[qname]
        name =
          ::SOAP::Mapping::DefaultRegistry.find_mapped_obj_class(klass).name
      else
        name = safeconstname(qname.name)
        if modulepath
          name = [modulepath, name].join('::')
        end
        while @classname.value?(name)
          name += '_'
        end
        check_classname(name)
      end
      @classname[key] = name.freeze
    end
    @classname[key]
  end

  def check_classname(name)
    if Object.constants.include?(name)
      warn("created definition re-opens an existing toplevel class: #{name}.  consider to use --module_path option of wsdl2ruby.rb")
    end
  end
end


end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
soybean-2.5.5 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.5.4 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.5.3 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.5.2 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.5.1 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.5.0 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.4.3 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.4.2 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.4.1 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.4.0 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.3.0 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.2.2 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.2.1 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.2.0 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.1.5 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.1.4 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.1.3 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.1.2 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.1.1 vendor/soap4r/wsdl/soap/class_name_creator.rb
soybean-2.1.0 vendor/soap4r/wsdl/soap/class_name_creator.rb