Class: SOAP::Header::HandlerSet
- Defined in:
- lib/action_web_service/soap/header/handlerset.rb
Instance Method Summary collapse
- #add(handler) ⇒ Object (also: #<<)
- #delete(handler) ⇒ Object
- #dup ⇒ Object
- #include?(handler) ⇒ Boolean
-
#initialize ⇒ HandlerSet
constructor
A new instance of HandlerSet.
-
#on_inbound(headers) ⇒ Object
headers: SOAPHeaderItem enumerable object.
-
#on_outbound ⇒ Object
returns: Array of SOAPHeaderItem.
Constructor Details
#initialize ⇒ HandlerSet
Returns a new instance of HandlerSet.
17 18 19 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 17 def initialize @store = XSD::NamedElements.new end |
Instance Method Details
#add(handler) ⇒ Object Also known as: <<
27 28 29 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 27 def add(handler) @store << handler end |
#delete(handler) ⇒ Object
32 33 34 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 32 def delete(handler) @store.delete(handler) end |
#dup ⇒ Object
21 22 23 24 25 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 21 def dup obj = HandlerSet.new obj.store = @store.dup obj end |
#include?(handler) ⇒ Boolean
36 37 38 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 36 def include?(handler) @store.include?(handler) end |
#on_inbound(headers) ⇒ Object
headers: SOAPHeaderItem enumerable object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 48 def on_inbound(headers) headers.each do |name, item| handler = @store.find { |handler| handler.elename == item.element.elename } if handler handler.on_inbound_headeritem(item) elsif item.mustunderstand raise UnhandledMustUnderstandHeaderError.new(item.element.elename.to_s) end end end |
#on_outbound ⇒ Object
returns: Array of SOAPHeaderItem
41 42 43 44 45 |
# File 'lib/action_web_service/soap/header/handlerset.rb', line 41 def on_outbound @store.collect { |handler| handler.on_outbound_headeritem }.compact end |