Class: Pageflow::AudioFile

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

Instance Method Summary collapse

Methods included from UploadedFile

#usage_id

Instance Method Details

#attachmentObject



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

def attachment
  attachment_on_s3
end

#attachment=(value) ⇒ Object



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

def attachment=(value)
  self.attachment_on_filesystem = value
end

#attachment_s3_urlObject



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

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

#m4aObject



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

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

#meta_data_attributes=(attributes) ⇒ Object



39
40
41
# File 'app/models/pageflow/audio_file.rb', line 39

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

#mp3Object



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

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

#oggObject



31
32
33
# File 'app/models/pageflow/audio_file.rb', line 31

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

#output_definitionObject



35
36
37
# File 'app/models/pageflow/audio_file.rb', line 35

def output_definition
  ZencoderAudioOutputDefinition.new(self)
end