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.
23 24 25 26 27 28 |
# File 'lib/soap/header/handler.rb', line 23 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.
18 19 20 |
# File 'lib/soap/header/handler.rb', line 18 def elename @elename end |
#encodingstyle ⇒ Object (readonly)
Returns the value of attribute encodingstyle.
20 21 22 |
# File 'lib/soap/header/handler.rb', line 20 def encodingstyle @encodingstyle end |
#mustunderstand ⇒ Object
Returns the value of attribute mustunderstand.
19 20 21 |
# File 'lib/soap/header/handler.rb', line 19 def mustunderstand @mustunderstand end |
#target_actor ⇒ Object (readonly)
Returns the value of attribute target_actor.
21 22 23 |
# File 'lib/soap/header/handler.rb', line 21 def target_actor @target_actor end |
Instance Method Details
#on_inbound(header, mustunderstand = false) ⇒ Object
Given header is a SOAPHeaderItem or nil.
36 37 38 |
# File 'lib/soap/header/handler.rb', line 36 def on_inbound(header, mustunderstand = false) # do something. end |
#on_inbound_headeritem(header, item) ⇒ Object
55 56 57 |
# File 'lib/soap/header/handler.rb', line 55 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.
31 32 33 |
# File 'lib/soap/header/handler.rb', line 31 def on_outbound nil end |
#on_outbound_headeritem(header) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/soap/header/handler.rb', line 40 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 else item.elename = @elename ::SOAP::SOAPHeaderItem.new(item, @mustunderstand, @encodingstyle, @target_actor) end end |