Sha256: 525e19cbe65c47274f20766f35e08420c8a414f17927b1aeb1db93ee89fea389

Contents?: true

Size: 755 Bytes

Versions: 3

Compression:

Stored size: 755 Bytes

Contents

module FCI
  def parse_folder_xml(folder_xml_file)
    doc = Nokogiri::XML.parse(folder_xml_file)
    folder_xml = doc.xpath("//folder").first

    folder = {
      id: folder_xml[:id],
      name: folder_xml.xpath('name').text,
      description: folder_xml.xpath('name').text,
      position: folder_xml[:position],
    }

    return folder
  end

  def parse_article_xml(article_xml_file)
    doc = Nokogiri::XML.parse(article_xml_file)
    article_xml = doc.xpath('//article').first

    article = {
      id: article_xml[:id],
      position: article_xml[:position],
      folder_id: article_xml[:folder_id],
      title: article_xml.xpath('title').text,
      description: article_xml.xpath('description').text,
    }

    return article
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fci-0.0.3 lib/fci/export.rb
fci-0.0.2 lib/fci/export.rb
fci-0.0.1 lib/fci/export.rb