Sha256: f9daa692336263bfc8921d58b7605d0aaaa8b61666f8d6e786ec2ac716efc031

Contents?: true

Size: 1.96 KB

Versions: 15

Compression:

Stored size: 1.96 KB

Contents

# encoding: ASCII-8BIT
# WSDL4R - XMLSchema attribute definition for WSDL.
# 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 'wsdl/info'
require 'wsdl/xmlSchema/ref'


module WSDL
module XMLSchema


class Attribute < Info
  include Ref

  attr_writer :use
  attr_writer :form
  attr_writer :name
  attr_writer :type
  attr_writer :local_simpletype
  attr_writer :default
  attr_writer :fixed

  attr_reader_ref :use
  attr_reader_ref :form
  attr_reader_ref :name
  attr_reader_ref :type
  attr_reader_ref :local_simpletype
  attr_reader_ref :default
  attr_reader_ref :fixed

  attr_accessor :arytype

  def initialize
    super
    @use = nil
    @form = nil
    @name = nil
    @type = nil
    @local_simpletype = nil
    @default = nil
    @fixed = nil
    @ref = nil
    @refelement = nil
    @arytype = nil
  end

  def targetnamespace
    parent.targetnamespace
  end

  def parse_element(element)
    case element
    when SimpleTypeName
      @local_simpletype = SimpleType.new
      @local_simpletype
    end
  end

  def parse_attr(attr, value)
    case attr
    when RefAttrName
      @ref = value
    when UseAttrName
      @use = value.source
    when FormAttrName
      @form = value.source
    when NameAttrName
      if directelement?
        @name = XSD::QName.new(targetnamespace, value.source)
      else
        @name = XSD::QName.new(nil, value.source)
      end
    when TypeAttrName
      @type = value
    when DefaultAttrName
      @default = value.source
    when FixedAttrName
      @fixed = value.source
    when ArrayTypeAttrName
      @arytype = value
    else
      nil
    end
  end

private

  def directelement?
    parent.is_a?(Schema)
  end

  def refelement
    @refelement ||= root.collect_attributes[@ref]
  end
end


end
end

Version data entries

15 entries across 15 versions & 9 rubygems

Version Path
malagant-soap4r-1.5.8.20141127181857 lib/wsdl/xmlSchema/attribute.rb
rtiss_soap4r-1.6.1 lib/wsdl/xmlSchema/attribute.rb
rtiss_soap4r-1.6.0 lib/wsdl/xmlSchema/attribute.rb
eSpace_soap4r-1.5.8 lib/wsdl/xmlSchema/attribute.rb
soap4r-ruby19-1.5.9 lib/wsdl/xmlSchema/attribute.rb
tomdz-soap4r-1.5.8.20120202093209 lib/wsdl/xmlSchema/attribute.rb
soap5r-2.0.3 lib/wsdl/xmlSchema/attribute.rb
soap5r-2.0.2 lib/wsdl/xmlSchema/attribute.rb
soap5r-2.0.1 lib/wsdl/xmlSchema/attribute.rb
soap5r-2.0.0 lib/wsdl/xmlSchema/attribute.rb
soap5r-2.0.0.20120130130121 lib/wsdl/xmlSchema/attribute.rb
soap4r-sgonyea-1.5.9 lib/wsdl/xmlSchema/attribute.rb
sunteya-soap4r-1.5.8.0 lib/wsdl/xmlSchema/attribute.rb
tomdz-soap4r-1.5.8.20111103171510 lib/wsdl/xmlSchema/attribute.rb
rubyjedi-soap4r-1.5.8.20100619003610 lib/wsdl/xmlSchema/attribute.rb