Class: LolSoap::WSDL::Type
- Inherits:
-
Object
- Object
- LolSoap::WSDL::Type
- Defined in:
- lib/lolsoap/wsdl/type.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
- #attributes ⇒ Object
- #element(name) ⇒ Object
- #element_prefix(name) ⇒ Object
- #elements ⇒ Object
- #has_attribute?(name) ⇒ Boolean
-
#initialize(name, prefix, elements, attributes) ⇒ Type
constructor
A new instance of Type.
- #inspect ⇒ Object
- #prefix_and_name ⇒ Object
- #sub_type(name) ⇒ Object
Constructor Details
#initialize(name, prefix, elements, attributes) ⇒ Type
Returns a new instance of Type.
7 8 9 10 11 12 |
# File 'lib/lolsoap/wsdl/type.rb', line 7 def initialize(name, prefix, elements, attributes) @name = name @prefix = prefix @elements = elements @attributes = Set.new(attributes) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/lolsoap/wsdl/type.rb', line 5 def name @name end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
5 6 7 |
# File 'lib/lolsoap/wsdl/type.rb', line 5 def prefix @prefix end |
Instance Method Details
#attributes ⇒ Object
30 31 32 |
# File 'lib/lolsoap/wsdl/type.rb', line 30 def attributes @attributes.to_a end |
#element(name) ⇒ Object
18 19 20 |
# File 'lib/lolsoap/wsdl/type.rb', line 18 def element(name) @elements.fetch(name) { NullElement.new } end |
#element_prefix(name) ⇒ Object
22 23 24 |
# File 'lib/lolsoap/wsdl/type.rb', line 22 def element_prefix(name) @elements.fetch(name, self).prefix end |
#elements ⇒ Object
14 15 16 |
# File 'lib/lolsoap/wsdl/type.rb', line 14 def elements @elements.dup end |
#has_attribute?(name) ⇒ Boolean
34 35 36 |
# File 'lib/lolsoap/wsdl/type.rb', line 34 def has_attribute?(name) @attributes.include?(name) end |
#inspect ⇒ Object
38 39 40 41 42 |
# File 'lib/lolsoap/wsdl/type.rb', line 38 def inspect "<#{self.class} name=\"#{prefix_and_name}\" " \ "elements=#{elements.inspect} " \ "attributes=#{attributes.inspect}>" end |
#prefix_and_name ⇒ Object
44 45 46 |
# File 'lib/lolsoap/wsdl/type.rb', line 44 def prefix_and_name "#{prefix}:#{name}" end |
#sub_type(name) ⇒ Object
26 27 28 |
# File 'lib/lolsoap/wsdl/type.rb', line 26 def sub_type(name) element(name).type end |