module IsoDoc::XrefGen::Anchor

Public Class Methods

new() click to toggle source
# File lib/isodoc/xref/xref_anchor.rb, line 22
def initialize
  @anchors = {}
end

Public Instance Methods

anchor_struct(lbl, container, elem, type, unnumb = false) click to toggle source
# File lib/isodoc/xref/xref_anchor.rb, line 50
def anchor_struct(lbl, container, elem, type, unnumb = false)
  ret = {}
  ret[:label] = unnumb == "true" ? nil : anchor_struct_label(lbl, elem)
  ret[:xref] = anchor_struct_xref(unnumb == "true" ? "(??)" : lbl, elem)
  ret[:xref].gsub!(/ $/, "")
  ret[:container] = @klass.get_clause_id(container) unless container.nil?
  ret[:type] = type
  ret[:value] = anchor_struct_value(lbl, elem)
  ret
end
anchor_struct_label(lbl, elem) click to toggle source
# File lib/isodoc/xref/xref_anchor.rb, line 30
def anchor_struct_label(lbl, elem)
  case elem
  when @labels["appendix"] then l10n("#{elem} #{lbl}")
  else
    lbl.to_s
  end
end
anchor_struct_value(lbl, elem) click to toggle source
# File lib/isodoc/xref/xref_anchor.rb, line 42
def anchor_struct_value(lbl, elem)
  case elem
  when @labels["formula"], @labels["inequality"] then "(#{lbl})"
  else
    lbl
  end
end
anchor_struct_xref(lbl, elem) click to toggle source
# File lib/isodoc/xref/xref_anchor.rb, line 38
def anchor_struct_xref(lbl, elem)
  l10n("#{elem} #{anchor_struct_value(lbl, elem)}")
end
get_anchors() click to toggle source
# File lib/isodoc/xref/xref_anchor.rb, line 26
def get_anchors
  @anchors
end