Class: SOAP::Header::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/soap/header/handler.rb

Direct Known Subclasses

MappingHandler, SimpleHandler

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Handler) initialize(elename)



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

- (Object) elename (readonly)

Returns the value of attribute elename



17
18
19
# File 'lib/soap/header/handler.rb', line 17

def elename
  @elename
end

- (Object) encodingstyle (readonly)

Returns the value of attribute encodingstyle



19
20
21
# File 'lib/soap/header/handler.rb', line 19

def encodingstyle
  @encodingstyle
end

- (Object) mustunderstand

Returns the value of attribute mustunderstand



18
19
20
# File 'lib/soap/header/handler.rb', line 18

def mustunderstand
  @mustunderstand
end

- (Object) target_actor (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

- (Object) on_inbound(header, mustunderstand = false)

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

- (Object) on_inbound_headeritem(header, item)



54
55
56
# File 'lib/soap/header/handler.rb', line 54

def on_inbound_headeritem(header, item)
  on_inbound(item.element, item.mustunderstand)
end

- (Object) on_outbound

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

- (Object) on_outbound_headeritem(header)



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 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
  else
    item.elename = @elename
    ::SOAP::SOAPHeaderItem.new(item, @mustunderstand, @encodingstyle,
      @target_actor)
  end
end