Sha256: cafbdf8ffbf5f4b2a182f044a914a0bbf8856ed907890cf390b3b0ed8d3f114f

Contents?: true

Size: 769 Bytes

Versions: 20

Compression:

Stored size: 769 Bytes

Contents

module Ddr::Models::Structures
  #
  # Wraps a Nokogiri (XML) 'metsHdr' node
  #
  class MetsHdr < SimpleDelegator

    def id
      self['ID']
    end

    def createdate
      self['CREATEDATE']
    end

    def lastmoddate
      self['LASTMODDATE']
    end

    def recordstatus
      self['RECORDSTATUS']
    end

    def agents
      xpath('xmlns:agent').map { |node| Agent.new(node) }
    end

    def self.build(args)
      node = Nokogiri::XML::Node.new('metsHdr', args[:document])
      node['ID'] = args[:id] if args[:id]
      node['CREATEDATE'] = args[:createdate] if args[:createdate]
      node['LASTMODDATE'] = args[:lastmoddate] if args[:lastmoddate]
      node['RECORDSTATUS'] = args[:recordstatus] if args[:recordstatus]
      node
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.10.2 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.10.1 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.10.0 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.10.0.rc2 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.10.0.rc1 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.9.2 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.9.1 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.9.0 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.9.0.rc1 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.8.0 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.8.0.rc1 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.6 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.5 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.4 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.3 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.2 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.1 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.0 lib/ddr/models/structures/mets_hdr.rb
ddr-models-2.7.0.rc1 lib/ddr/models/structures/mets_hdr.rb