Class: Docxi::Word::Relationships::Relationship
- Inherits:
-
Object
- Object
- Docxi::Word::Relationships::Relationship
- Defined in:
- lib/docxi/word/relationships/relationship.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#target ⇒ Object
Returns the value of attribute target.
-
#tm ⇒ Object
Returns the value of attribute tm.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #build(xml) ⇒ Object
-
#initialize(id, type, target, tm = '') ⇒ Relationship
constructor
A new instance of Relationship.
Constructor Details
#initialize(id, type, target, tm = '') ⇒ Relationship
Returns a new instance of Relationship.
8 9 10 11 12 13 |
# File 'lib/docxi/word/relationships/relationship.rb', line 8 def initialize(id, type, target, tm = '') @id = id @type = type @target = target @tm = tm end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/docxi/word/relationships/relationship.rb', line 6 def id @id end |
#target ⇒ Object
Returns the value of attribute target.
6 7 8 |
# File 'lib/docxi/word/relationships/relationship.rb', line 6 def target @target end |
#tm ⇒ Object
Returns the value of attribute tm.
6 7 8 |
# File 'lib/docxi/word/relationships/relationship.rb', line 6 def tm @tm end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/docxi/word/relationships/relationship.rb', line 6 def type @type end |
Instance Method Details
#build(xml) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/docxi/word/relationships/relationship.rb', line 15 def build(xml) if @tm.blank? xml.Relationship('Id' => @id, 'Type' => @type, 'Target' => @target) else xml.Relationship('Id' => @id, 'Type' => @type, 'Target' => @target, 'TargetMode' => @tm) end end |