Class Spreadsheet::Link
In: lib/spreadsheet/link.rb
Parent: String
Column Format Row Font Enumerable Worksheet\n[lib/spreadsheet/excel.rb\nlib/spreadsheet/worksheet.rb] Link Workbook Workbook\n[lib/spreadsheet/excel.rb\nlib/spreadsheet/excel/workbook.rb] SstEntry String Row Array Worksheet ExcelCompatibleWorkbook Format Worksheet Workbook DelegateClassSpreadsheet::Format Writer Compatibility Formula Reader\n[lib/parseexcel/parseexcel.rb\nlib/spreadsheet/excel/reader.rb\nlib/spreadsheet/excel/reader/biff5.rb\nlib/spreadsheet/excel/reader/biff8.rb] Error lib/spreadsheet/excel.rb lib/spreadsheet/link.rb lib/spreadsheet/formula.rb lib/spreadsheet/workbook.rb lib/spreadsheet/font.rb lib/spreadsheet/column.rb lib/spreadsheet/format.rb lib/spreadsheet/writer.rb lib/spreadsheet/row.rb Encodings lib/spreadsheet/excel.rb lib/spreadsheet/excel/row.rb lib/spreadsheet/excel/reader/biff5.rb lib/spreadsheet/excel/worksheet.rb lib/spreadsheet/excel/sst_entry.rb lib/spreadsheet/excel/error.rb lib/spreadsheet/excel/workbook.rb lib/spreadsheet/excel/writer/format.rb lib/spreadsheet/excel/writer/workbook.rb lib/spreadsheet/excel/writer/worksheet.rb Biff8 Writer Biff5 Biff8 Internals Offset Excel Datatypes ParseExcel Compatibility Spreadsheet dot/m_34_0.png

The Link class. Is a Subclass of String, which lets you treat a Cell that contains a Link just as if it was a String (containing the link‘s description if there is one or the url with fragment otherwise), but gives you access to the url, fragment and target_frame if you need it.

Interesting Attributes

url :The Uniform Resource Location this Link points to.
fragment :Also called text mark: example.com/page.html#fragment
target_frame :Which frame a Link should be opened in, should also support the special frames _blank, _parent, _self and _top.
dos :Excel may store a DOS-Filename together with the long Filename introduced in VFAT. You probably will not need this, but if you do, here is where you can find it.

Methods

href   new   to_uri  

Included Modules

Encodings

Attributes

dos  [RW] 
fragment  [RW] 
target_frame  [RW] 
url  [RW] 

Public Class methods

[Source]

    # File lib/spreadsheet/link.rb, line 23
23:     def initialize url='', description=url, fragment=nil
24:       super description
25:       @url = url
26:       @fragment = fragment
27:     end

Public Instance methods

The Url with the fragment appended if present.

[Source]

    # File lib/spreadsheet/link.rb, line 30
30:     def href
31:       href = (@url || @dos).to_s.dup
32:       if @fragment
33:         href << client('#') << @fragment
34:       end
35:       href
36:     end

Attempts to parse the output of href. May raise a URI::InvalidURIError

[Source]

    # File lib/spreadsheet/link.rb, line 39
39:     def to_uri
40:       URI.parse href
41:     end

[Validate]