Sha256: a0259c94fc612cfc08842db104f8157732873cb4e6f770aa48e77f815fcd6c71

Contents?: true

Size: 718 Bytes

Versions: 27

Compression:

Stored size: 718 Bytes

Contents

module Pageflow
  class AudioFile < ApplicationRecord
    include UploadableFile
    include MediaEncodingStateMachine

    belongs_to :confirmed_by, class_name: 'User', optional: true

    def attachment_s3_url
      "s3://#{File.join(attachment.bucket_name, attachment.path)}"
    end

    def m4a
      ZencoderAttachment.new(self, "audio.m4a")
    end

    def mp3
      ZencoderAttachment.new(self, "audio.mp3")
    end

    def ogg
      ZencoderAttachment.new(self, "audio.ogg")
    end

    def output_definition
      ZencoderAudioOutputDefinition.new(self)
    end

    def meta_data_attributes=(attributes)
      self.attributes = attributes.symbolize_keys.slice(:format, :duration_in_ms)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
pageflow-15.6.1 app/models/pageflow/audio_file.rb
pageflow-15.6.0 app/models/pageflow/audio_file.rb
pageflow-15.5.0 app/models/pageflow/audio_file.rb
pageflow-15.4.0 app/models/pageflow/audio_file.rb
pageflow-15.3.0 app/models/pageflow/audio_file.rb
pageflow-15.2.2 app/models/pageflow/audio_file.rb
pageflow-15.2.1 app/models/pageflow/audio_file.rb
pageflow-15.2.0 app/models/pageflow/audio_file.rb
pageflow-15.1.2 app/models/pageflow/audio_file.rb
pageflow-15.1.1 app/models/pageflow/audio_file.rb
pageflow-15.1.0 app/models/pageflow/audio_file.rb
pageflow-15.1.0.rc0 app/models/pageflow/audio_file.rb
pageflow-15.1.0.beta6 app/models/pageflow/audio_file.rb
pageflow-15.1.0.beta5 app/models/pageflow/audio_file.rb
pageflow-15.1.0.beta4 app/models/pageflow/audio_file.rb
pageflow-15.1.0.beta3 app/models/pageflow/audio_file.rb
pageflow-15.1.0.beta2 app/models/pageflow/audio_file.rb
pageflow-15.1.0.beta1 app/models/pageflow/audio_file.rb
pageflow-15.0.2 app/models/pageflow/audio_file.rb
pageflow-15.0.1 app/models/pageflow/audio_file.rb