Sha256: 2c5ee244d5bc105cb729917114274762c6b08cec8fb7ecb291b7b69a949db541

Contents?: true

Size: 881 Bytes

Versions: 12

Compression:

Stored size: 881 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 element_prefix(name)
      @elements.fetch(name, self).prefix
    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_and_name}\" " \
        "elements=#{elements.inspect} " \
        "attributes=#{attributes.inspect}>"
    end

    def prefix_and_name
      "#{prefix}:#{name}"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lolsoap-0.11.0 lib/lolsoap/wsdl/type.rb
lolsoap-0.10.0 lib/lolsoap/wsdl/type.rb
lolsoap-0.9.0 lib/lolsoap/wsdl/type.rb
lolsoap-0.8.3 lib/lolsoap/wsdl/type.rb
lolsoap-0.8.2 lib/lolsoap/wsdl/type.rb
lolsoap-0.8.1 lib/lolsoap/wsdl/type.rb
lolsoap-0.8.0 lib/lolsoap/wsdl/type.rb
lolsoap-0.7.0 lib/lolsoap/wsdl/type.rb
lolsoap-0.6.1 lib/lolsoap/wsdl/type.rb
lolsoap-0.6.0 lib/lolsoap/wsdl/type.rb
lolsoap-0.5.1 lib/lolsoap/wsdl/type.rb
lolsoap-0.5.0 lib/lolsoap/wsdl/type.rb