class DoctorNinja::Relationships

Public Class Methods

new(doc) click to toggle source
# File lib/doctor_ninja/relationships.rb, line 3
def initialize(doc)
  @doc = doc
  @rels = Nokogiri::XML @doc.read "word/_rels/document.xml.rels"
end

Public Instance Methods

[](id)
Alias for: read
path(id) click to toggle source
# File lib/doctor_ninja/relationships.rb, line 14
def path id
  @rels.xpath("//*[@Id=\"#{id}\"]").attribute("Target").value
rescue
  nil
end
read(id) click to toggle source
# File lib/doctor_ninja/relationships.rb, line 8
def read id
  @doc.read "word/#{path id}"
end
Also aliased as: []