Class: Relaton::Render::Iho::Parse

Inherits:
Parse
  • Object
show all
Defined in:
lib/relaton/render/parse.rb

Instance Method Summary collapse

Instance Method Details

#uri(doc) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/relaton/render/parse.rb', line 5

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