Class: Pageflow::TextTrackFile

Inherits:
ApplicationRecord show all
Includes:
HostedFile, ProcessedFileStateMachine
Defined in:
app/models/pageflow/text_track_file.rb

Instance Method Summary collapse

Methods included from ProcessedFileStateMachine

#failed?, #ready?, #retry!, #retryable?

Methods included from HostedFile

#attachment, #attachment=, #attachment_default_url, #basename, #can_upload?, #failed?, #original_url, #ready?, #retryable?, #url

Methods included from UploadedFile

#cache_key, #can_upload?, #direct_upload_config, #file_type, #nested_files, #parent_allows_type_for_nesting, #parent_belongs_to_same_entry

Instance Method Details

#attachment_styles(_attachment) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'app/models/pageflow/text_track_file.rb', line 6

def attachment_styles(_attachment)
  {
    vtt: {
      format: 'vtt',
      processors: [:pageflow_vtt],
      s3_headers: {
        'Content-Type' => 'text/vtt'
      }
    }
  }
end

#attachments_path_nameObject

used in paperclip initializer to interpolate the storage path needs to be “processed_attachments” for text tracks for legacy reasons



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

def attachments_path_name
  'processed_attachments'
end

#meta_data_attributes=(attributes) ⇒ Object



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

def (attributes)
  self.attributes = attributes.symbolize_keys.slice(:label, :kind, :srclang)
end