Class: OAI::Provider::Response::GetRecord

Inherits:
RecordResponse show all
Defined in:
lib/oai/provider/response/get_record.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #provider

Instance Method Summary collapse

Methods inherited from RecordResponse

#about_for, #data_for, #header_for, inherited

Methods inherited from Base

default_parameters, #initialize, required_parameters, #response, valid_parameters

Constructor Details

This class inherits a constructor from OAI::Provider::Response::Base

Instance Method Details

#to_xmlObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/oai/provider/response/get_record.rb', line 6

def to_xml
  id = extract_identifier(options.delete(:identifier))
  unless record = provider.model.find(id, options)
    raise OAI::IdException.new
  end

  response do |r|
    r.GetRecord do
      r.record do
        header_for record
        data_for record unless deleted?(record)
        about_for record unless deleted?(record)
      end
    end
  end
end