Class: SOAP::SOAPHeader

Inherits:
SOAPStruct show all
Includes:
SOAPEnvelopeElement
Defined in:
lib/soap/element.rb

Constant Summary

Constants included from SOAP

AttrActor, AttrArrayType, AttrArrayTypeName, AttrEncodingStyle, AttrEncodingStyleName, AttrMustUnderstand, AttrMustUnderstandName, AttrOffset, AttrOffsetName, AttrPosition, AttrPositionName, AttrRoot, AttrRootName, Base64Literal, EleBody, EleBodyName, EleEnvelope, EleEnvelopeName, EleFault, EleFaultActor, EleFaultActorName, EleFaultCode, EleFaultCodeName, EleFaultDetail, EleFaultDetailName, EleFaultName, EleFaultString, EleFaultStringName, EleHeader, EleHeaderName, EncodingNamespace, EnvelopeNamespace, LiteralNamespace, MediaType, NextActor, PropertyName, SOAPNamespaceTag, TypeMap, VERSION, ValueArray, ValueArrayName, XSDNamespaceTag, XSINamespaceTag

Instance Attribute Summary

Attributes included from SOAPType

#definedtype, #elename, #encodingstyle, #extraattr, #id, #parent, #position, #precedents, #root

Instance Method Summary collapse

Methods inherited from SOAPStruct

#[], #[]=, decode, #each, #key?, #members, #replace, #to_obj, #to_s

Methods included from Enumerable

#inject

Methods included from SOAPType

#inspect, #rootnode

Constructor Details

#initializeSOAPHeader

Returns a new instance of SOAPHeader.



182
183
184
185
186
# File 'lib/soap/element.rb', line 182

def initialize
  super(nil)
  @elename = EleHeaderName
  @encodingstyle = nil
end

Instance Method Details

#add(name, value) ⇒ Object



197
198
199
200
201
202
# File 'lib/soap/element.rb', line 197

def add(name, value)
  mu = (value.extraattr[AttrMustUnderstandName] == '1')
  encstyle = value.extraattr[AttrEncodingStyleName]
  item = SOAPHeaderItem.new(value, mu, encstyle)
  super(name, item)
end

#encode(generator, ns, attrs = {}) ⇒ Object



188
189
190
191
192
193
194
195
# File 'lib/soap/element.rb', line 188

def encode(generator, ns, attrs = {})
  name = ns.name(@elename)
  generator.encode_tag(name, attrs)
  @data.each do |data|
    yield(data)
  end
  generator.encode_tag_end(name, true)
end

#lengthObject Also known as: size



204
205
206
# File 'lib/soap/element.rb', line 204

def length
  @data.length
end