Class: DCSerializer

Inherits:
ASpaceExport::Serializer show all
Defined in:
backend/app/exporters/serializers/dc.rb

Instance Method Summary collapse

Methods inherited from ASpaceExport::Serializer

inherited, serializer_for, serializer_for?, with_namespace

Instance Method Details

#build(dc, opts = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'backend/app/exporters/serializers/dc.rb', line 4

def build(dc, opts = {})
  builder = Nokogiri::XML::Builder.new(:encoding => "UTF-8") do |xml|
    _root(dc, xml)
  end

  builder
end

#serialize(dc, opts = {}) ⇒ Object



12
13
14
15
16
# File 'backend/app/exporters/serializers/dc.rb', line 12

def serialize(dc, opts = {})
  builder = build(dc, opts)

  builder.to_xml
end

#serialize_dc(dc, xml) ⇒ Object



18
19
20
# File 'backend/app/exporters/serializers/dc.rb', line 18

def serialize_dc(dc, xml)
  _root(dc, xml)
end