Class: LolSoap::Builder
- Inherits:
-
Object
- Object
- LolSoap::Builder
- Defined in:
- lib/lolsoap/builder.rb
Overview
Used to build XML, with namespaces automatically added.
Constant Summary collapse
- RESERVED_METHODS =
%w(object_id respond_to_missing? inspect === to_s)
Instance Method Summary collapse
-
#[](prefix) ⇒ Object
Specify a namespace prefix explicitly.
-
#__node__ ⇒ Object
Node accessor.
-
#__tag__(name, *args, &block) ⇒ Object
(also: #method_missing)
Add a tag manually, rather than through method_missing.
-
#__type__ ⇒ Object
Type accessor.
-
#initialize(node, type = WSDL::NullType.new) ⇒ Builder
constructor
A new instance of Builder.
- #respond_to?(name) ⇒ Boolean
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object (private)
Add a tag manually, rather than through method_missing. This is so you can still add tags for the very small number of tags that are also existing methods.
91 92 93 |
# File 'lib/lolsoap/builder.rb', line 91 def __tag__(name, *args, &block) __prefixed_tag__(@type.prefix, @type.sub_type(name.to_s), name, *args, &block) end |
Instance Method Details
#[](prefix) ⇒ Object
Specify a namespace prefix explicitly
81 82 83 |
# File 'lib/lolsoap/builder.rb', line 81 def [](prefix) Prefix.new(self, prefix) end |
#__node__ ⇒ Object
Node accessor. Named to prevent method_missing conflict.
71 72 73 |
# File 'lib/lolsoap/builder.rb', line 71 def __node__ @node end |
#__tag__(name, *args, &block) ⇒ Object Also known as: method_missing
Add a tag manually, rather than through method_missing. This is so you can still add tags for the very small number of tags that are also existing methods.
54 55 56 |
# File 'lib/lolsoap/builder.rb', line 54 def __tag__(name, *args, &block) __prefixed_tag__(@type.prefix, @type.sub_type(name.to_s), name, *args, &block) end |
#__type__ ⇒ Object
Type accessor. Named to prevent method_missing conflict.
76 77 78 |
# File 'lib/lolsoap/builder.rb', line 76 def __type__ @type end |
#respond_to?(name) ⇒ Boolean
85 86 87 |
# File 'lib/lolsoap/builder.rb', line 85 def respond_to?(name) true end |