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.14.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.13.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.13.1 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.13.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.12.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.12.1 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.12.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.11.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.10.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.9.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.8.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.7.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.6 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.5 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.4 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.3 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.2 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.1 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.6.0 app/models/concerns/ddr/has_intermediate_file.rb
ddr-core-1.5.5 app/models/concerns/ddr/has_intermediate_file.rb