Class: SOAP::Header::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/soap/header/handler.rb

Direct Known Subclasses

SimpleHandler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elename) ⇒ Handler

Returns a new instance of Handler.


21
22
23
24
25
# File 'lib/soap/header/handler.rb', line 21

def initialize(elename)
  @elename = elename
  @mustunderstand = false
  @encodingstyle = nil
end

Instance Attribute Details

#elenameObject (readonly)

Returns the value of attribute elename


17
18
19
# File 'lib/soap/header/handler.rb', line 17

def elename
  @elename
end

#encodingstyleObject (readonly)

Returns the value of attribute encodingstyle


19
20
21
# File 'lib/soap/header/handler.rb', line 19

def encodingstyle
  @encodingstyle
end

#mustunderstandObject (readonly)

Returns the value of attribute mustunderstand


18
19
20
# File 'lib/soap/header/handler.rb', line 18

def mustunderstand
  @mustunderstand
end

Instance Method Details

#on_inbound(header, mustunderstand = false) ⇒ Object

Given header is a SOAPHeaderItem or nil.


33
34
35
# File 'lib/soap/header/handler.rb', line 33

def on_inbound(header, mustunderstand = false)
  # do something.
end

#on_inbound_headeritem(header) ⇒ Object


50
51
52
# File 'lib/soap/header/handler.rb', line 50

def on_inbound_headeritem(header)
  on_inbound(header.element, header.mustunderstand)
end

#on_outboundObject

Should return a SOAP/OM, a SOAPHeaderItem or nil.


28
29
30
# File 'lib/soap/header/handler.rb', line 28

def on_outbound
  nil
end

#on_outbound_headeritemObject


37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/soap/header/handler.rb', line 37

def on_outbound_headeritem
  item = on_outbound
  if item.nil?
    nil
  elsif item.is_a?(::SOAP::SOAPHeaderItem)
    item.elename = @elename
    item
  else
    item.elename = @elename
    ::SOAP::SOAPHeaderItem.new(item, @mustunderstand, @encodingstyle)
  end
end