Class: OAI::Provider::Response::ListSets

Inherits:
Base
  • Object
show all
Defined in:
backend/app/lib/oai/oai_gem_patches/list_sets_response.rb

Instance Method Summary collapse

Methods inherited from Base

#parse_date

Instance Method Details

#to_xmlObject

Raises:

  • (OAI::SetException)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'backend/app/lib/oai/oai_gem_patches/list_sets_response.rb', line 5

def to_xml
  raise OAI::SetException.new unless provider.model.sets

  response do |r|
    r.ListSets do
      provider.model.sets.each do |set|
        r.set do
          r.setSpec set.spec
          r.setName set.name
          if set.respond_to?(:description) && set.description
            r << set.description
          end
        end
      end
    end
  end
end