Class: DocXify::Element::WebAddress
- Defined in:
- lib/docxify/element/web_address.rb
Instance Attribute Summary collapse
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(target) ⇒ WebAddress
constructor
A new instance of WebAddress.
- #reference ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(target) ⇒ WebAddress
Returns a new instance of WebAddress.
6 7 8 9 |
# File 'lib/docxify/element/web_address.rb', line 6 def initialize(target) super() @target = target end |
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target.
4 5 6 |
# File 'lib/docxify/element/web_address.rb', line 4 def target @target end |
Instance Method Details
#reference ⇒ Object
11 12 13 |
# File 'lib/docxify/element/web_address.rb', line 11 def reference "url-#{Digest::SHA1.hexdigest(target)[0, 8]}" end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/docxify/element/web_address.rb', line 15 def to_s "<Relationship Id=\"#{reference}\" Target=\"#{target}/\" TargetMode=\"External\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\"/>" end |