class ActiveStorage::Analyzer

ActiveStorage::Analyzer::VideoAnalyzer for an example of a concrete subclass.
This is an abstract base class for analyzers, which extract metadata from blobs. See

def self.accept?(blob)

the analyzer can extract metadata.
Implement this method in a concrete subclass. Have it return true when given a blob from which
def self.accept?(blob)
  false
end

def self.analyze_later?

should be done in a job or performed inline. By default, analysis is enqueued in a job.
Implement this method in concrete subclasses. It will determine if blob analysis
def self.analyze_later?
  true
end

def download_blob_to_tempfile(&block) # :doc:

:doc:
Downloads the blob to a tempfile on disk. Yields the tempfile.
def download_blob_to_tempfile(&block) # :doc:
  blob.open tmpdir: tmpdir, &block
end

def initialize(blob)

def initialize(blob)
  @blob = blob
end

def instrument(analyzer, &block) # :doc:

:doc:
def instrument(analyzer, &block) # :doc:
  ActiveSupport::Notifications.instrument("analyze.active_storage", analyzer: analyzer, &block)
end

def logger # :doc:

:doc:
def logger # :doc:
  ActiveStorage.logger
end

def metadata

Override this method in a concrete subclass. Have it return a Hash of metadata.
def metadata
  raise NotImplementedError
end

def tmpdir # :doc:

:doc:
def tmpdir # :doc:
  Dir.tmpdir
end