lib/lolsoap/wsdl/element.rb in lolsoap-0.2.0 vs lib/lolsoap/wsdl/element.rb in lolsoap-0.3.0
- old
+ new
@@ -1,25 +1,30 @@
class LolSoap::WSDL
class Element
- attr_reader :name
+ attr_reader :name, :prefix, :type_reference
- def initialize(wsdl, name, type_name, singular = true)
- @wsdl = wsdl
- @name = name
- @type_name = type_name
- @singular = singular
+ def initialize(wsdl, name, prefix, type_reference, singular = true)
+ @wsdl = wsdl
+ @name = name
+ @prefix = prefix
+ @type_reference = type_reference
+ @singular = singular
end
+ def type
+ type_reference.type
+ end
+
def singular?
@singular == true
end
- def type
- @type ||= wsdl.type(@type_name)
+ def inspect
+ "<#{self.class} name=#{prefix_and_name.inspect} type=#{type.to_s.inspect}>"
end
- def inspect
- "<#{self.class} name=#{name.inspect} type=#{@type_name.inspect}>"
+ def prefix_and_name
+ "#{prefix}:#{name}"
end
private
def wsdl; @wsdl; end