Sha256: facde1df556055e11e943693ca452c9b853319ec0218bf515be8fcaa170d9b9c

Contents?: true

Size: 618 Bytes

Versions: 6

Compression:

Stored size: 618 Bytes

Contents

module Worthwhile
  module CurationConcern

    module_function
    
    def mint_a_pid
      Sufia::Noid.namespaceize(Sufia::Noid.noidify(Sufia::IdService.mint))
    end  

    def actor(curation_concern, *args)
      actor_identifier = curation_concern.class.to_s.split('::').last
      klass = "CurationConcern::#{actor_identifier}Actor".constantize
      klass.new(curation_concern, *args)
    end
    
    def attach_file(generic_file, user, file_to_attach)
      Sufia::GenericFile::Actor.new(generic_file, user).create_content(file_to_attach, file_to_attach.original_filename, 'content')
    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
worthwhile-0.1.2 app/services/worthwhile/curation_concern.rb
worthwhile-0.1.1 app/services/worthwhile/curation_concern.rb
worthwhile-0.1.0 app/services/worthwhile/curation_concern.rb
worthwhile-0.0.3 app/services/worthwhile/curation_concern.rb
worthwhile-0.0.2 app/services/worthwhile/curation_concern.rb
worthwhile-0.0.1 app/services/worthwhile/curation_concern.rb