Flowdock
method

parse_attr

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: WSDL::XMLSchema::Element
parse_attr(attr, value) public

No documentation

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

Hide source
# File lib/wsdl/xmlSchema/element.rb, line 108
  def parse_attr(attr, value)
    case attr
    when NameAttrName
      # namespace may be nil
      if directelement? or elementform == 'qualified'
        @name = XSD::QName.new(targetnamespace, value.source)
      else
        @name = XSD::QName.new(nil, value.source)
      end
    when FormAttrName
      @form = value.source
    when TypeAttrName
      @type = value
    when RefAttrName
      @ref = value
    when MaxOccursAttrName
      if parent.is_a?(All)
        if value.source != '1'
          raise Parser::AttrConstraintError.new(
            "cannot parse #{value} for #{attr}")
        end
      end
      @maxoccurs = value.source
    when MinOccursAttrName
      if parent.is_a?(All)
        unless ['0', '1'].include?(value.source)
          raise Parser::AttrConstraintError.new(
            "cannot parse #{value} for #{attr}")
        end
      end
      @minoccurs = value.source
    when NillableAttrName
      @nillable = (value.source == 'true')
    else
      nil
    end
  end
Register or log in to add new notes.