Sha256: 5888eae8418519273e5af6107465ee7146fafb3c13f0178e0d584326aaf89ace

Contents?: true

Size: 458 Bytes

Versions: 6

Compression:

Stored size: 458 Bytes

Contents

module Ddr::Models
  class AttachedFilesProfile
    include ActiveModel::Serializers::JSON

    attr_reader :files_hash

    # @param files_hash [ActiveFedora::FilesHash]
    def initialize(files_hash)
      @files_hash = files_hash
    end

    def attributes
      files_hash.keys.each_with_object({}) { |k, memo| memo[k.to_s] = nil }
    end

    def read_attribute_for_serialization(key)
      AttachedFileProfile.new(files_hash[key])
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.4 lib/ddr/models/attached_files_profile.rb
ddr-models-3.0.0.beta.3 lib/ddr/models/attached_files_profile.rb
ddr-models-3.0.0.beta.2 lib/ddr/models/attached_files_profile.rb
ddr-models-3.0.0.beta.1 lib/ddr/models/attached_files_profile.rb
ddr-models-3.0.0.alpha.4 lib/ddr/models/attached_files_profile.rb
ddr-models-3.0.0.alpha.3 lib/ddr/models/attached_files_profile.rb