class ActiveStorage::Analyzer
ActiveStorage::Analyzer::ImageAnalyzer 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)
Implement this method in a concrete subclass. Have it return true when given a blob from which
def self.accept?(blob) false end
def download_blob_to_tempfile(&block) #: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 logger #:doc:
def logger #:doc: ActiveStorage.logger end
def metadata
def metadata raise NotImplementedError end
def tmpdir #:doc:
def tmpdir #:doc: Dir.tmpdir end