Sha256: 6b81f61a19d256f5f52bca4e66f331f1611fd01d3e66ed891b5c0eadcc9d8802

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

module FedoraMigrate
  class DatesMover < Mover

    Report = Struct.new(:uploaded, :modified)

    def migrate
      migrate_date_uploaded if source.respond_to?(:createdDate) && target.respond_to?(:date_uploaded)
      migrate_date_modified if source.respond_to?(:lastModifiedDate) && target.respond_to?(:date_modified)
      super
    end

    def results_report
      Report.new
    end

    def migrate_date_uploaded
      target.date_uploaded = source.createdDate
      report.uploaded = source.createdDate
    end

    def migrate_date_modified
      target.date_modified = source.lastModifiedDate
      report.modified = source.lastModifiedDate
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fedora-migrate-0.3.0 lib/fedora_migrate/dates_mover.rb
fedora-migrate-0.2.0 lib/fedora_migrate/dates_mover.rb