Sha256: 32e75b5eac5e49882cf5b2229c80bcea935b64557badbde5a6272bedacfad367

Contents?: true

Size: 722 Bytes

Versions: 1

Compression:

Stored size: 722 Bytes

Contents

module Sufia
  module Export
    # Convert a Collection including metadata, permissions and member ids into a PORO
    # so that the metadata can be exported in json format using to_json
    #
    class CollectionConverter < Converter
      # Create an instance of a Collection converter containing all the metadata for json export
      #
      # @param [Collection] collection to be converted for export
      def initialize(collection)
        @id = collection.id
        @title = collection.title
        @description = collection.description
        @creator = collection.creator.map { |c| c }
        @members = collection.members.map(&:id)
        @permissions = permissions(collection)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sufia-6.7.0 lib/sufia/export/collection_converter.rb