Sha256: 55af00569558ef7f6dd86888a9b68074d2e844a5a0aecf62e243f1547b1d7b21

Contents?: true

Size: 712 Bytes

Versions: 15

Compression:

Stored size: 712 Bytes

Contents

module Pageflow
  class AudioFile < ApplicationRecord
    include HostedFile
    include EncodedFileStateMachine

    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

15 entries across 15 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/models/pageflow/audio_file.rb
pageflow-14.5.1 app/models/pageflow/audio_file.rb
pageflow-14.5.0 app/models/pageflow/audio_file.rb
pageflow-14.4.0 app/models/pageflow/audio_file.rb
pageflow-14.3.0 app/models/pageflow/audio_file.rb
pageflow-14.2.1 app/models/pageflow/audio_file.rb
pageflow-14.2.0 app/models/pageflow/audio_file.rb
pageflow-14.1.1 app/models/pageflow/audio_file.rb
pageflow-14.1.0 app/models/pageflow/audio_file.rb
pageflow-14.0.0 app/models/pageflow/audio_file.rb
pageflow-14.0.0.rc2 app/models/pageflow/audio_file.rb
pageflow-14.0.0.rc1 app/models/pageflow/audio_file.rb
pageflow-14.0.0.beta3 app/models/pageflow/audio_file.rb
pageflow-14.0.0.beta2 app/models/pageflow/audio_file.rb
pageflow-14.0.0.beta1 app/models/pageflow/audio_file.rb