Class: Axlsx::Relationship
- Inherits:
-
Object
- Object
- Axlsx::Relationship
- Defined in:
- lib/axlsx/rels/relationship.rb
Overview
Note:
Packages automatcially manage relationships.
A relationship defines a reference between package parts.
Instance Attribute Summary (collapse)
-
- (String) Target
The location of the relationship target.
-
- (String) Type
The type of relationship.
Instance Method Summary (collapse)
-
- (Relationship) initialize(type, target)
constructor
A new instance of Relationship.
-
- (String) to_xml(xml, rId)
Serializes the relationship TODO: use object.rId to get this infomation.
Constructor Details
- (Relationship) initialize(type, target)
A new instance of Relationship
24 25 26 27 |
# File 'lib/axlsx/rels/relationship.rb', line 24 def initialize(type, target) self.Target=target self.Type=type end |
Instance Attribute Details
- (String) Target
The location of the relationship target
8 9 10 |
# File 'lib/axlsx/rels/relationship.rb', line 8 def Target @Target end |
- (String) Type
Note:
Supported types are defined as constants in Axlsx:
The type of relationship
23 24 25 |
# File 'lib/axlsx/rels/relationship.rb', line 23 def Type @Type end |
Instance Method Details
- (String) to_xml(xml, rId)
Serializes the relationship TODO: use object.rId to get this infomation
37 38 39 40 41 |
# File 'lib/axlsx/rels/relationship.rb', line 37 def to_xml(xml, rId) h = self.instance_values h[:Id] = rId xml.Relationship(h) end |