class SOAP::SOAPHeaderItem

Attributes

actor[RW]
element[RW]
encodingstyle[RW]
mustunderstand[RW]

Public Class Methods

new(element, mustunderstand = true, encodingstyle = nil, actor = nil) click to toggle source
Calls superclass method SOAP::SOAPCompoundtype.new
# File lib/soap/element.rb, line 157
def initialize(element, mustunderstand = true, encodingstyle = nil, actor = nil)
  super()
  @type = nil
  @element = element
  @mustunderstand = mustunderstand
  @encodingstyle = encodingstyle
  @actor = actor
  element.parent = self if element
  element.qualified = true
end

Public Instance Methods

encode(generator, ns, attrs = {}) { |element| ... } click to toggle source
# File lib/soap/element.rb, line 168
def encode(generator, ns, attrs = {})
  attrs.each do |key, value|
    @element.extraattr[key] = value
  end
  # to remove mustUnderstand attribute, set it to nil
  unless @mustunderstand.nil?
    @element.extraattr[AttrMustUnderstandName] = (@mustunderstand ? '1' : '0')
  end
  if @encodingstyle
    @element.extraattr[AttrEncodingStyleName] = @encodingstyle
  end
  unless @element.encodingstyle
    @element.encodingstyle = @encodingstyle
  end
  if @actor
    @element.extraattr[AttrActorName] = @actor
  end
  yield(@element)
end