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
-
#Target ⇒ String
The location of the relationship target.
-
#Type ⇒ String
The type of relationship.
Instance Method Summary collapse
-
#initialize(type, target) ⇒ Relationship
constructor
A new instance of Relationship.
-
#to_xml(xml, rId) ⇒ String
Serializes the relationship.
Constructor Details
#initialize(type, target) ⇒ Relationship
Returns 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
#Target ⇒ String
The location of the relationship target
8 9 10 |
# File 'lib/axlsx/rels/relationship.rb', line 8 def Target @Target end |
#Type ⇒ String
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
#to_xml(xml, rId) ⇒ String
Serializes the relationship
38 39 40 41 42 |
# File 'lib/axlsx/rels/relationship.rb', line 38 def to_xml(xml, rId) h = self.instance_values h[:Id] = rId xml.Relationship(h) end |