Sha256: 4b475440c360278cc32ce42c3988f107c379d15430719bfdcb087f95100369c0

Contents?: true

Size: 514 Bytes

Versions: 40

Compression:

Stored size: 514 Bytes

Contents

module Ddr
  module HasIntermediateFile
    extend ActiveSupport::Concern

    included do
      attribute :intermediate_file, Ddr::File.optional
    end

    def intermediate_type
      intermediate_file&.media_type
    end

    # This method is used in dul-hydra 'ComponentsController'
    def intermediate_extension
      if filename = intermediate_file&.original_filename
        ::File.extname(filename)
      end
    end

    def intermediate_path
      intermediate_file&.file&.disk_path
    end

  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
ddr-core-1.5.4 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.5.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.5.3 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.5.1 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.4.4 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.4.3 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.4.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.4.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.3.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.2.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.2.0.rc3 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.2.0.rc2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.2.0.rc1 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.1.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.1.1 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.1.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.0.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-0.3.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-0.2.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-0.2.1 app/models/concerns/ddr/has_intermediate_file.rb