Class: Pageflow::AudioFile

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
EncodedFileStateMachine, HostedFile
Defined in:
app/models/pageflow/audio_file.rb

Instance Method Summary collapse

Methods included from EncodedFileStateMachine

#retryable?

Methods included from HostedFile

#attachment, #attachment=, columns, #keep_on_filesystem_after_upload_to_s3?, #retryable?, #url

Methods included from UploadedFile

#usage_id

Instance Method Details

#attachment_s3_urlObject


8
9
10
# File 'app/models/pageflow/audio_file.rb', line 8

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

#m4aObject


12
13
14
# File 'app/models/pageflow/audio_file.rb', line 12

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

#meta_data_attributes=(attributes) ⇒ Object


28
29
30
# File 'app/models/pageflow/audio_file.rb', line 28

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

#mp3Object


16
17
18
# File 'app/models/pageflow/audio_file.rb', line 16

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

#oggObject


20
21
22
# File 'app/models/pageflow/audio_file.rb', line 20

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

#output_definitionObject


24
25
26
# File 'app/models/pageflow/audio_file.rb', line 24

def output_definition
  ZencoderAudioOutputDefinition.new(self)
end