Class: NeonDocuments::DocumentProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/neon_documents/document_processor.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unprocessed_document_id:) ⇒ DocumentProcessor

Returns a new instance of DocumentProcessor.



11
12
13
# File 'lib/neon_documents/document_processor.rb', line 11

def initialize(unprocessed_document_id:)
  @unprocessed_document_id = unprocessed_document_id
end

Class Method Details

.encode_and_store_document(unprocessed_document_id:) ⇒ Object



5
6
7
8
9
# File 'lib/neon_documents/document_processor.rb', line 5

def self.encode_and_store_document(unprocessed_document_id:)
  new(
    unprocessed_document_id: unprocessed_document_id
  ).encode_and_store_document
end

Instance Method Details

#encode_and_store_documentObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/neon_documents/document_processor.rb', line 15

def encode_and_store_document
  filename = case document_template.name
  when "Webpage Screenshot"
    NeonDocuments::DocumentTemplates::WebpageScreenshot.processed_filename(
      unprocessed_filename: unprocessed_document
    )
  end

  puts filename
end