Class: PersistentAttachments::VAForm

Inherits:
PersistentAttachment
  • Object
show all
Defined in:
app/models/persistent_attachments/va_form.rb

Constant Summary collapse

CONFIGS =
Hash.new(
  { max_pages: 10, min_pages: 1 }
).merge(
  {
    '21-0779' => { max_pages: 4, min_pages: 2 }
  }
)

Instance Method Summary collapse

Instance Method Details

#as_json(options = {}) ⇒ Object



28
29
30
# File 'app/models/persistent_attachments/va_form.rb', line 28

def as_json(options = {})
  super(options).merge(warnings:)
end

#delete_fileObject (private)



34
35
36
# File 'app/models/persistent_attachments/va_form.rb', line 34

def delete_file
  file.delete
end

#max_pagesObject



16
17
18
# File 'app/models/persistent_attachments/va_form.rb', line 16

def max_pages
  CONFIGS[form_id][:max_pages]
end

#min_pagesObject



20
21
22
# File 'app/models/persistent_attachments/va_form.rb', line 20

def min_pages
  CONFIGS[form_id][:min_pages]
end

#warningsObject



24
25
26
# File 'app/models/persistent_attachments/va_form.rb', line 24

def warnings
  @warnings ||= []
end