Class: Pageflow::TextTrackFile

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

Instance Method Summary collapse

Methods included from ImageAndTextTrackProcessingStateMachine

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

Methods included from UploadableFile

#attachment, #attachment=, #attachment_default_url, #attachments_for_export, #basename, #can_upload?, #direct_upload_config, #failed?, #publish!, #ready?, #retryable?, #url

Methods included from ReusableFile

#attachments_for_export, #basename, #cache_key, #can_upload?, #failed?, #file_name, #file_type, #nested_files, #original_url, #parent_allows_type_for_nesting, #parent_belongs_to_same_entry, #publish!, #ready?, #retry!, #retryable?, #url

Instance Method Details

#attachment_styles(_attachment) ⇒ Object

UploadableFile-overrides ->



17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/pageflow/text_track_file.rb', line 17

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



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

def attachments_path_name
  'processed_attachments'
end

#meta_data_attributes=(attributes) ⇒ Object



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

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