Sha256: a201c8c9cacd1ea6d8ffd0e57c67dc76283aa75ca61b2cdb35cb397e852997bb
Contents?: true
Size: 1.07 KB
Versions: 17
Compression:
Stored size: 1.07 KB
Contents
module Axlsx #A collection of hyperlink objects for a worksheet class WorksheetHyperlinks < SimpleTypedList # Creates a new Hyperlinks collection # @param [Worksheet] worksheet the worksheet that owns these hyperlinks def initialize(worksheet) DataTypeValidator.validate "Hyperlinks.worksheet", [Worksheet], worksheet @worksheet = worksheet super WorksheetHyperlink end # Creates and adds a new hyperlink based on the options provided # @see WorksheetHyperlink#initialize # @return [WorksheetHyperlink] def add(options) self << WorksheetHyperlink.new(@worksheet, options) last end # The relationships required by this collection's hyperlinks # @return Array def relationships return [] if empty? map { |hyperlink| hyperlink.relationship } end # seralize the collection of hyperlinks # @return [String] def to_xml_string(str='') return if empty? str << '<hyperlinks>' each { |hyperlink| hyperlink.to_xml_string(str) } str << '</hyperlinks>' end end end
Version data entries
17 entries across 17 versions & 6 rubygems