class Xlsxrb::Ooxml::Reader::HyperlinksListener
SAX2 listener for parsing <hyperlinks><hyperlink> elements.
Attributes
links
[R]
untyped
Public Class Methods
() → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb, line 728 def initialize @links = [] end
Public Instance Methods
(untyped _uri, untyped local_name, untyped qname, untyped attributes) → untyped
Source
# File lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb, line 732 def start_element(_uri, local_name, qname, attributes) name = element_name(local_name, qname) return unless name == "hyperlink" ref = attributes["ref"] return unless ref link = { ref: ref } rid = attributes["r:id"] || attributes["id"] || attributes.find { |k, _| k.end_with?(":id") }&.last link[:rid] = rid if rid link[:display] = attributes["display"] if attributes["display"] link[:tooltip] = attributes["tooltip"] if attributes["tooltip"] link[:location] = attributes["location"] if attributes["location"] @links << link end