Flowdock
method

define_attribute

Importance_0
v1_8_6_287 - Show latest stable - 0 notes - Class: WSDL::SOAP::ClassDefCreator
define_attribute(c, attributes) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/wsdl/soap/classDefCreator.rb, line 223
  def define_attribute(c, attributes)
    schema_attribute = []
    attributes.each do |attribute|
      name = name_attribute(attribute)
      if klass = attribute_basetype(attribute)
        type = klass.name
      else
        type = nil
      end
      methodname = safemethodname('xmlattr_' + name.name)
      c.def_method(methodname) do "(@__xmlattr ||= {})[\#{dqname(name)}]\n"
      end
      c.def_method(methodname + '=', 'value') do "(@__xmlattr ||= {})[\#{dqname(name)}] = value\n"
      end
      schema_attribute << [name, type]
    end
    c.def_classvar('schema_attribute',
      '{' +
        schema_attribute.collect { |name, type|
          dqname(name) + ' => ' + ndq(type)
        }.join(', ') +
      '}'
    )
  end
Register or log in to add new notes.