Class: Docxer::Relationships
- Inherits:
-
Object
- Object
- Docxer::Relationships
- Defined in:
- lib/docxer/relationships.rb,
lib/docxer/relationships/relationship.rb
Defined Under Namespace
Classes: Relationship
Constant Summary collapse
- @@prefix =
'rId'
Instance Attribute Summary collapse
-
#relationships ⇒ Object
Returns the value of attribute relationships.
Instance Method Summary collapse
- #add(type, target) ⇒ Object
-
#initialize ⇒ Relationships
constructor
A new instance of Relationships.
- #render(zip) ⇒ Object
Constructor Details
#initialize ⇒ Relationships
Returns a new instance of Relationships.
9 10 11 12 13 14 15 |
# File 'lib/docxer/relationships.rb', line 9 def initialize @relationships = [] @counter = 0 add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "word/document.xml") add("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", "docProps/core.xml") add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", "docProps/app.xml") end |
Instance Attribute Details
#relationships ⇒ Object
Returns the value of attribute relationships.
7 8 9 |
# File 'lib/docxer/relationships.rb', line 7 def relationships @relationships end |
Instance Method Details
#add(type, target) ⇒ Object
17 18 19 20 21 |
# File 'lib/docxer/relationships.rb', line 17 def add(type, target) relationship = create_relationship(sequence, type, target) @relationships << relationship if relationship relationship end |