Sha256: 04e53ea874e5dc488324b5aebcb75922d5c52182e0afeceebc23cca2868b8345

Contents?: true

Size: 677 Bytes

Versions: 31

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Ingredients
    # A audio attachment
    #
    class Audio < Alchemy::Ingredient
      store_accessor :data,
        :autoplay,
        :controls,
        :muted,
        :loop

      allow_settings %i[except only]

      related_object_alias :attachment, class_name: "Alchemy::Attachment"

      delegate :name, to: :attachment, allow_nil: true

      # The first 30 characters of the attachments name
      #
      # Used by the Element#preview_text method.
      #
      # @param [Integer] max_length (30)
      #
      def preview_text(max_length = 30)
        name.to_s[0..max_length - 1]
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
alchemy_cms-7.2.1 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.13 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.8 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.7 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.12 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.11 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.6 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.5 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.10 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.4 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.9 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.3 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.2 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.1 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.0 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.0.pre.rc1 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.0.pre.b2 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.1.0.pre.b1 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.8 app/models/alchemy/ingredients/audio.rb
alchemy_cms-7.0.7 app/models/alchemy/ingredients/audio.rb