class Decontaminate::Decoder::Array

Attributes

decoder[R]
xpath[R]

Public Class Methods

new(xpath, decoder) click to toggle source
# File lib/decontaminate/decoder/array.rb, line 6
def initialize(xpath, decoder)
  @xpath = xpath
  @decoder = decoder
end

Public Instance Methods

decode(this, xml_node) click to toggle source
# File lib/decontaminate/decoder/array.rb, line 11
def decode(this, xml_node)
  children = xml_node && xml_node.xpath(xpath)
  return [] unless children
  children.map do |child|
    decoder.decode this, child
  end
end