Sha256: 1029635e4d68299e48a265401e6492f95810803ada816ba4d8376dcf2472614c

Contents?: true

Size: 711 Bytes

Versions: 7

Compression:

Stored size: 711 Bytes

Contents

module Pageflow
  class AudioFile < ApplicationRecord
    include HostedFile
    include EncodedFileStateMachine

    belongs_to :confirmed_by, :class_name => 'User'

    def attachment_s3_url
      "s3://#{File.join(attachment_on_s3.bucket_name, attachment_on_s3.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

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-12.6.0 app/models/pageflow/audio_file.rb
pageflow-12.5.0 app/models/pageflow/audio_file.rb
pageflow-12.4.1 app/models/pageflow/audio_file.rb
pageflow-12.4.0 app/models/pageflow/audio_file.rb
pageflow-12.3.0 app/models/pageflow/audio_file.rb
pageflow-12.2.0 app/models/pageflow/audio_file.rb
pageflow-12.1.0 app/models/pageflow/audio_file.rb