Class: Docxi::Relationships::Relationship

Inherits:
Object
  • Object
show all
Defined in:
lib/docxi/relationships/relationship.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, type, target) ⇒ Relationship

Returns a new instance of Relationship.



7
8
9
10
11
# File 'lib/docxi/relationships/relationship.rb', line 7

def initialize(id, type, target)
  @id = id
  @type = type
  @target = target
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/docxi/relationships/relationship.rb', line 5

def id
  @id
end

#targetObject

Returns the value of attribute target.



5
6
7
# File 'lib/docxi/relationships/relationship.rb', line 5

def target
  @target
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/docxi/relationships/relationship.rb', line 5

def type
  @type
end

Instance Method Details

#build(xml) ⇒ Object



13
14
15
# File 'lib/docxi/relationships/relationship.rb', line 13

def build(xml)
  xml.Relationship('Id' => @id, 'Type' => @type, 'Target' => @target)
end