Method: IsoDoc::PresentationXMLConvert#combine_conn

Defined in:
lib/isodoc/presentation_function/xrefs.rb

#combine_conn(list) ⇒ Object



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/isodoc/presentation_function/xrefs.rb', line 148

def combine_conn(list)
  list.size == 1 and list.first[:label]
  if list[1..].all? { |l| l[:conn] == "and" }
    connectives_spans(@i18n.boolean_conj(list.map do |l|
      loc2xref(l)
    end, "and"))
  elsif list[1..].all? { |l| l[:conn] == "or" }
    connectives_spans(@i18n.boolean_conj(list.map do |l|
      loc2xref(l)
    end, "or"))
  else
    ret = loc2xref(list[0])
    list[1..].each { |l| ret = i18n_chain_boolean(ret, l) }
    ret
  end
end