class SOAP::Header::HandlerSet

Public Class Methods

new() click to toggle source
# File lib/soap/header/handlerset.rb, line 17
def initialize
  @store = XSD::NamedElements.new
end

Public Instance Methods

<<(handler)
Alias for: add
add(handler) click to toggle source
# File lib/soap/header/handlerset.rb, line 27
def add(handler)
  @store << handler
end
Also aliased as: <<
delete(handler) click to toggle source
# File lib/soap/header/handlerset.rb, line 32
def delete(handler)
  @store.delete(handler)
end
dup() click to toggle source
# File lib/soap/header/handlerset.rb, line 21
def dup
  obj = HandlerSet.new
  obj.store = @store.dup
  obj
end
include?(handler) click to toggle source
# File lib/soap/header/handlerset.rb, line 36
def include?(handler)
  @store.include?(handler)
end
on_inbound(headers) click to toggle source

headers: SOAPHeaderItem enumerable object

# File lib/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() click to toggle source

returns: Array of SOAPHeaderItem

# File lib/soap/header/handlerset.rb, line 41
def on_outbound
  @store.collect { |handler|
    handler.on_outbound_headeritem
  }.compact
end

Protected Instance Methods

store=(store) click to toggle source
# File lib/soap/header/handlerset.rb, line 63
def store=(store)
  @store = store
end