Class: Decontaminate::Decoder::ChildNodeProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/decontaminate/decoder/child_node_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xpath, decoder) ⇒ ChildNodeProxy

Returns a new instance of ChildNodeProxy.



6
7
8
9
# File 'lib/decontaminate/decoder/child_node_proxy.rb', line 6

def initialize(xpath, decoder)
  @xpath = xpath
  @decoder = decoder
end

Instance Attribute Details

#decoderObject (readonly)

Returns the value of attribute decoder.



4
5
6
# File 'lib/decontaminate/decoder/child_node_proxy.rb', line 4

def decoder
  @decoder
end

#xpathObject (readonly)

Returns the value of attribute xpath.



4
5
6
# File 'lib/decontaminate/decoder/child_node_proxy.rb', line 4

def xpath
  @xpath
end

Instance Method Details

#decode(this, xml_node) ⇒ Object



11
12
13
14
# File 'lib/decontaminate/decoder/child_node_proxy.rb', line 11

def decode(this, xml_node)
  child = xml_node && xml_node.at_xpath(xpath)
  decoder.decode this, child
end