source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/soap/header/simplehandler.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 964 bytes
Line 
1# SOAP4R - SOAP Simple header item handler
2# Copyright (C) 2003-2005 NAKAMURA, Hiroshi <[email protected]>.
3
4# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
5# redistribute it and/or modify it under the same terms of Ruby's license;
6# either the dual license version in 2003, or any later version.
7
8
9require 'soap/header/handler'
10require 'soap/baseData'
11
12
13module SOAP
14module Header
15
16
17class SimpleHandler < SOAP::Header::Handler
18 def initialize(elename)
19 super(elename)
20 end
21
22 # Should return a Hash, String or nil.
23 def on_simple_outbound
24 nil
25 end
26
27 # Given header is a Hash, String or nil.
28 def on_simple_inbound(header, mustunderstand)
29 end
30
31 def on_outbound
32 h = on_simple_outbound
33 h ? SOAPElement.from_obj(h, elename.namespace) : nil
34 end
35
36 def on_inbound(header, mustunderstand)
37 h = header.respond_to?(:to_obj) ? header.to_obj : header.data
38 on_simple_inbound(h, mustunderstand)
39 end
40end
41
42
43end
44end
Note: See TracBrowser for help on using the repository browser.