# File library_solution.rb, line 71 def get_link(isbn) doc = get_avail(isbn, :isbn) rn = doc.root.elements['t'].attribute('rn') if rn.nil? return nil else ac = tc = 0 doc.elements.each("r/t/lo") { |lo| ac += lo.attributes.get_attribute('ac').value.to_i ; tc += lo.attributes.get_attribute('tc').value.to_i } return "<a href=\"http://#{@web_server_address}#{@detail_url}#{rn.to_s}\">#{ac} of #{tc} available</a>" end end