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.



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

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

Instance Attribute Details

#registryObject

Returns the value of attribute registry.



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

def registry
  @registry
end

Instance Method Details

#on_inbound(header, mustunderstand) ⇒ Object



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

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



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

def on_mapping_inbound(obj, mustunderstand)
end

#on_mapping_outboundObject

Should return an Object for mapping



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

def on_mapping_outbound
  nil
end

#on_outboundObject



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

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