lib/ews/soap/builders/ews_builder.rb
# Build the SOAP envelope and yield this object so sub-elements can be built. Once
# you have the EwsBuilder object you can use the nbuild object like shown in the
# example for the Header section. The nbuild object is the underlying
# Nokogiri::XML::Builder object.
# @param [Hash] opts
# @option opts [String] :server_version The version string that should get
#   set in the Header. See ExchangeWebService#initialize
# @option opts [Hash] :time_zone_context TimeZoneDefinition. Format: !{id: time_zone_identifier}
# @example
#   xb = EwsBuilder.new
#   xb.build! do |part, b|
#     if(part == :header)
#       b.nbuild.MyVar('blablabla')
#     else
#       b.folder_shape!({:base_shape => 'Default'})
#     end
#   end
Build the SOAP envelope and yield this object so sub-elements can be built. Once
you have the EwsBuilder object you can use the nbuild object like shown in the
example for the Header section. The nbuild object is the underlying
Nokogiri::XML::Builder object.
Build the SOAP envelope and yield this object so sub - elements can be built . Once you have the EwsBuilder object you can use the nbuild object like shown in the example for the Header section . The nbuild object is the underlying Nokogiri :: XML :: Builder object .
def build!(opts = {}, &block)
      @nbuild.Envelope(NAMESPACES) do |node|
        node.parent.namespace = parent_namespace(node)
        node.Header {
          set_version_header! opts[:server_version]
          set_impersonation! opts[:impersonation_type], opts[:impersonation_mail]
          set_time_zone_context_header! opts[:time_zone_context]
          yield(:header, self) if block_given?
        }
        node.Body { yield(:body, self) if block_given? }
      end
      @nbuild.doc
    end
def build! ( opts = { } , & block ) @nbuild . Envelope ( NAMESPACES ) do | node | node . parent . namespace = parent_namespace ( node ) node . Header { set_version_header! opts [ :server_version ] set_impersonation! opts [ :impersonation_type ] , opts [ :impersonation_mail ] set_time_zone_context_header! opts [ :time_zone_context ] yield ( :header , self ) if block_given? } node . Body { yield ( :body , self ) if block_given? } end @nbuild . doc end
Build the SOAP envelope and yield this object so sub-elements can be built.
Build the SOAP envelope and yield this object so sub - elements can be built .
opts
:time_zone_context TimeZoneDefinition. Format: !{id: time_zone_identifier}
: time_zone_context TimeZoneDefinition . Format : ! { id : time_zone_identifier }
block
<not_specific>
<not_specific>
None
example
xb = EwsBuilder.new xb.build. do |part, b| if(part == :header) b.nbuild.MyVar('blablabla') else b.folder_shape!({:base_shape => 'Default'}) end end
xb = EwsBuilder . new xb . build . do |part b| if ( part == : header ) b . nbuild . MyVar ( ' blablabla ' ) else b . folder_shape! ( { : base_shape = > ' Default ' } ) end end