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.



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

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



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

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

#seen(elem) ⇒ Object



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

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