Class: SOAP::Header::Handler
Direct Known Subclasses
Instance Attribute Summary collapse
-
#elename ⇒ Object
readonly
Returns the value of attribute elename.
-
#encodingstyle ⇒ Object
readonly
Returns the value of attribute encodingstyle.
-
#mustunderstand ⇒ Object
Returns the value of attribute mustunderstand.
-
#target_actor ⇒ Object
readonly
Returns the value of attribute target_actor.
Instance Method Summary collapse
-
#initialize(elename) ⇒ Handler
constructor
A new instance of Handler.
-
#on_inbound(header, mustunderstand = false) ⇒ Object
Given header is a SOAPHeaderItem or nil.
- #on_inbound_headeritem(header, item) ⇒ Object
-
#on_outbound ⇒ Object
Should return a SOAP/OM, a SOAPHeaderItem or nil.
- #on_outbound_headeritem(header) ⇒ Object
Constructor Details
#initialize(elename) ⇒ Handler
Returns a new instance of Handler.
22 23 24 25 26 27 |
# File 'lib/soap/header/handler.rb', line 22 def initialize(elename) @elename = elename @mustunderstand = false @encodingstyle = nil @target_actor = nil end |
Instance Attribute Details
#elename ⇒ Object (readonly)
Returns the value of attribute elename.
17 18 19 |
# File 'lib/soap/header/handler.rb', line 17 def elename @elename end |
#encodingstyle ⇒ Object (readonly)
Returns the value of attribute encodingstyle.
19 20 21 |
# File 'lib/soap/header/handler.rb', line 19 def encodingstyle @encodingstyle end |
#mustunderstand ⇒ Object
Returns the value of attribute mustunderstand.
18 19 20 |
# File 'lib/soap/header/handler.rb', line 18 def mustunderstand @mustunderstand end |
#target_actor ⇒ Object (readonly)
Returns the value of attribute target_actor.
20 21 22 |
# File 'lib/soap/header/handler.rb', line 20 def target_actor @target_actor end |
Instance Method Details
#on_inbound(header, mustunderstand = false) ⇒ Object
Given header is a SOAPHeaderItem or nil.
35 36 37 |
# File 'lib/soap/header/handler.rb', line 35 def on_inbound(header, mustunderstand = false) # do something. end |
#on_inbound_headeritem(header, item) ⇒ Object
57 58 59 |
# File 'lib/soap/header/handler.rb', line 57 def on_inbound_headeritem(header, item) on_inbound(item.element, item.mustunderstand) end |
#on_outbound ⇒ Object
Should return a SOAP/OM, a SOAPHeaderItem or nil.
30 31 32 |
# File 'lib/soap/header/handler.rb', line 30 def on_outbound nil end |
#on_outbound_headeritem(header) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/soap/header/handler.rb', line 39 def on_outbound_headeritem(header) arity = self.method(:on_outbound).arity item = (arity == 0) ? on_outbound : on_outbound(header) if item.nil? nil elsif item.is_a?(::SOAP::SOAPHeaderItem) item.elename = @elename item elsif item.is_a?(::SOAP::SOAPElement) item.elename = @elename item else item.elename = @elename ::SOAP::SOAPHeaderItem.new(item, @mustunderstand, @encodingstyle, @target_actor) end end |