Class: RubyPoint::Relationship
- Defined in:
- lib/rubypoint/relationship.rb
Direct Known Subclasses
PresentationRel::PresProps, PresentationRel::PrinterSettings, PresentationRel::Slide, PresentationRel::SlideMaster, PresentationRel::TableStyles, PresentationRel::Theme, PresentationRel::ViewProps
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#rel_id ⇒ Object
Returns the value of attribute rel_id.
Attributes inherited from Element
#objects, #parent, #presentation
Instance Method Summary collapse
-
#initialize(parent, object = false) ⇒ Relationship
constructor
A new instance of Relationship.
- #raw ⇒ Object
- #write ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(parent, object = false) ⇒ Relationship
Returns a new instance of Relationship.
6 7 8 9 10 11 12 13 |
# File 'lib/rubypoint/relationship.rb', line 6 def initialize(parent, object=false) @parent = parent @rel_id = parent.next_rel_id if object @object = object @object.rel_id = @rel_id end end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/rubypoint/relationship.rb', line 3 def object @object end |
#rel_id ⇒ Object
Returns the value of attribute rel_id.
3 4 5 |
# File 'lib/rubypoint/relationship.rb', line 3 def rel_id @rel_id end |
Instance Method Details
#raw ⇒ Object
19 20 21 22 23 |
# File 'lib/rubypoint/relationship.rb', line 19 def raw raw = <<EOF <Relationship Id="rId#{self.rel_id}" Type="#{self.type}" Target="#{self.target}"/> EOF end |
#write ⇒ Object
15 16 17 |
# File 'lib/rubypoint/relationship.rb', line 15 def write @parent.doc.search('//Relationships').append(self.raw) end |