Sha256: 0601020e1d6a901583ee281389cfaed9442428a05c40d4618dbe3ddddcf4b8c2

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

require_relative 'relationships/relationship'
module OoxmlParser
  # Class for describing list of relationships
  class Relationships
    # @return [Array, Relationship] array of relationships
    attr_accessor :relationship

    def initialize
      @relationship = []
    end

    # @return [Array, Column] accessor for relationship
    def [](key)
      @relationship[key]
    end

    # Parse Relationships
    # @param [Nokogiri::XML:Node] node with Relationships
    # @return [Relationships] result of parsing
    def self.parse(node)
      rels = Relationships.new
      node.xpath('*').each do |node_children|
        case node_children.name
        when 'Relationship'
          rels.relationship << Relationship.parse(node_children)
        end
      end
      rels
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/common_parser/common_data/relationships.rb