Method: UnAPI::Service#formats

Defined in:
lib/unapi/service.rb

#formatsObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/unapi/service.rb', line 16

def formats()
  @status_code, @document, @content_type = Utils.get_document(@url)
  return [] if ! @document

  formats = []
  @document.elements.each('.//formats/format') do |e|
    formats << Format.new_from_element(e)
  end
  @last_url = @url
  return formats
end