Class: OpenXml::Xlsx::Elements::Relationship
- Inherits:
-
Struct
- Object
- Struct
- OpenXml::Xlsx::Elements::Relationship
- Defined in:
- lib/openxml/xlsx/elements/relationship.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#target ⇒ Object
Returns the value of attribute target.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, target, id = nil) ⇒ Relationship
constructor
A new instance of Relationship.
- #to_xml(xml) ⇒ Object
Constructor Details
#initialize(type, target, id = nil) ⇒ Relationship
Returns a new instance of Relationship.
8 9 10 11 |
# File 'lib/openxml/xlsx/elements/relationship.rb', line 8 def initialize(type, target, id=nil) id ||= "R#{SecureRandom.hex}" super type, target, id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
6 7 8 |
# File 'lib/openxml/xlsx/elements/relationship.rb', line 6 def id @id end |
#target ⇒ Object
Returns the value of attribute target
6 7 8 |
# File 'lib/openxml/xlsx/elements/relationship.rb', line 6 def target @target end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/openxml/xlsx/elements/relationship.rb', line 6 def type @type end |
Instance Method Details
#to_xml(xml) ⇒ Object
13 14 15 |
# File 'lib/openxml/xlsx/elements/relationship.rb', line 13 def to_xml(xml) xml.Relationship("Id" => id, "Type" => type, "Target" => target) end |