metanorma/metanorma-iho

View on GitHub
lib/relaton/render/parse.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Relaton
  module Render
    module Iho
      class Parse < ::Relaton::Render::Parse
        def uri(doc)
          uri = nil
          %w(src).each do |t|
            uri = doc.link.detect { |u| u.type == t } and break
          end
          uri ||= doc.link.first
          return nil unless uri

          uri.content.to_s
        end
      end
    end
  end
end