show.xml.ruby 488 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. doc = Ox::Document.new(version: '1.0')
  3. ins = Ox::Instruct.new(:xml).tap do |instruct|
  4. instruct[:version] = '1.0'
  5. instruct[:encoding] = 'UTF-8'
  6. end
  7. doc << ins
  8. doc << Ox::Element.new('XRD').tap do |xrd|
  9. xrd['xmlns'] = 'http://docs.oasis-open.org/ns/xri/xrd-1.0'
  10. xrd << Ox::Element.new('Link').tap do |link|
  11. link['rel'] = 'lrdd'
  12. link['template'] = @webfinger_template
  13. end
  14. end
  15. Ox.dump(doc, effort: :tolerant).force_encoding('UTF-8')