Class: SOAP::Header::MappingHandler

Inherits:
Handler show all
Defined in:
lib/soap/header/mappinghandler.rb

Instance Attribute Summary collapse

Attributes inherited from Handler

#elename, #encodingstyle, #mustunderstand, #target_actor

Instance Method Summary collapse

Methods inherited from Handler

#on_inbound_headeritem, #on_outbound_headeritem

Constructor Details

#initialize(elename, registry = nil) ⇒ MappingHandler

Returns a new instance of MappingHandler.


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

def initialize(elename, registry = nil)
  super(elename)
  @registry = registry
end

Instance Attribute Details

#registryObject

Returns the value of attribute registry


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

def registry
  @registry
end

Instance Method Details

#on_inbound(header, mustunderstand) ⇒ Object


40
41
42
43
# File 'lib/soap/header/mappinghandler.rb', line 40

def on_inbound(header, mustunderstand)
  obj = SOAP::Mapping.soap2obj(header, @registry)
  on_mapping_inbound(obj, mustunderstand)
end

#on_mapping_inbound(obj, mustunderstand) ⇒ Object

Given header is a mapped Object


32
33
# File 'lib/soap/header/mappinghandler.rb', line 32

def on_mapping_inbound(obj, mustunderstand)
end

#on_mapping_outboundObject

Should return an Object for mapping


27
28
29
# File 'lib/soap/header/mappinghandler.rb', line 27

def on_mapping_outbound
  nil
end

#on_outboundObject


35
36
37
38
# File 'lib/soap/header/mappinghandler.rb', line 35

def on_outbound
  obj = on_mapping_outbound
  obj ? SOAP::Mapping.obj2soap(obj, @registry, @elename) : nil
end