Sha256: b64f1a459234fe99c14084fea2859ab20ab8e1333c5a039ba31458456567990e

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

require 'set'

class LolSoap::WSDL
  class Type
    attr_reader :name, :prefix

    def initialize(name, prefix, elements, attributes)
      @name       = name
      @prefix     = prefix
      @elements   = elements
      @attributes = Set.new(attributes)
    end

    def elements
      @elements.dup
    end

    def element(name)
      @elements.fetch(name) { NullElement.new }
    end

    def sub_type(name)
      element(name).type
    end

    def attributes
      @attributes.to_a
    end

    def has_attribute?(name)
      @attributes.include?(name)
    end

    def inspect
      "<#{self.class} name=\"#{prefix}:#{name}\" " \
        "elements=#{elements.inspect} " \
        "attributes=#{attributes.inspect}>"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lolsoap-0.2.0 lib/lolsoap/wsdl/type.rb