Class: IsoDoc::XrefGen::Anchor::SeenAnchor

Inherits:
Object
  • Object
show all
Defined in:
lib/isodoc/xref/xref_anchor.rb

Instance Method Summary collapse

Constructor Details

#initialize(xmldoc) ⇒ SeenAnchor

Returns a new instance of SeenAnchor.



8
9
10
11
12
13
14
# File 'lib/isodoc/xref/xref_anchor.rb', line 8

def initialize(xmldoc)
  @seen = {}
  # ignore all metanorma-extension ids
  xmldoc.xpath("//xmlns:metanorma-extension//*[@id]").each do |x|
    add(x["id"])
  end
end

Instance Method Details

#add(elem) ⇒ Object



20
21
22
# File 'lib/isodoc/xref/xref_anchor.rb', line 20

def add(elem)
  @seen[elem] = true
end

#seen(elem) ⇒ Object



16
17
18
# File 'lib/isodoc/xref/xref_anchor.rb', line 16

def seen(elem)
  @seen.has_key?(elem)
end