Sha256: fa82d6b9adf82014e4a8e6039bf3f63462ed07167781e014af8644a488557882

Contents?: true

Size: 487 Bytes

Versions: 43

Compression:

Stored size: 487 Bytes

Contents

module Ddr
  module Captionable
    extend ActiveSupport::Concern

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

    def caption_type
      caption&.media_type
    end

    # This method is used in dul-hydra 'ComponentsController' and ddr-public 'CaptionsController'
    def caption_extension
      if filename = caption&.original_filename
        ::File.extname(filename)
      end
    end

    def caption_path
      caption&.file&.disk_path
    end

  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
ddr-core-1.6.1 app/models/concerns/ddr/captionable.rb
ddr-core-1.6.0 app/models/concerns/ddr/captionable.rb
ddr-core-1.5.5 app/models/concerns/ddr/captionable.rb
ddr-core-1.5.4 app/models/concerns/ddr/captionable.rb
ddr-core-1.5.2 app/models/concerns/ddr/captionable.rb
ddr-core-1.5.3 app/models/concerns/ddr/captionable.rb
ddr-core-1.5.1 app/models/concerns/ddr/captionable.rb
ddr-core-1.4.4 app/models/concerns/ddr/captionable.rb
ddr-core-1.4.3 app/models/concerns/ddr/captionable.rb
ddr-core-1.4.2 app/models/concerns/ddr/captionable.rb
ddr-core-1.4.0 app/models/concerns/ddr/captionable.rb
ddr-core-1.3.0 app/models/concerns/ddr/captionable.rb
ddr-core-1.2.0 app/models/concerns/ddr/captionable.rb
ddr-core-1.2.0.rc3 app/models/concerns/ddr/captionable.rb
ddr-core-1.2.0.rc2 app/models/concerns/ddr/captionable.rb
ddr-core-1.2.0.rc1 app/models/concerns/ddr/captionable.rb
ddr-core-1.1.2 app/models/concerns/ddr/captionable.rb
ddr-core-1.1.1 app/models/concerns/ddr/captionable.rb
ddr-core-1.1.0 app/models/concerns/ddr/captionable.rb
ddr-core-1.0.0 app/models/concerns/ddr/captionable.rb