Class: BreezyPDF::Uploads::FileFormData
- Inherits:
-
Object
- Object
- BreezyPDF::Uploads::FileFormData
- Defined in:
- lib/breezy_pdf/uploads/file_form_data.rb
Overview
Compose the form data for an HTTP POST of a file
Instance Method Summary collapse
- #boundary ⇒ Object
- #data ⇒ Object
-
#initialize(fields, content_type, filename, file) ⇒ FileFormData
constructor
A new instance of FileFormData.
Constructor Details
#initialize(fields, content_type, filename, file) ⇒ FileFormData
Returns a new instance of FileFormData.
8 9 10 11 12 13 |
# File 'lib/breezy_pdf/uploads/file_form_data.rb', line 8 def initialize(fields, content_type, filename, file) @fields = fields @content_type = content_type @filename = filename @file = file end |
Instance Method Details
#boundary ⇒ Object
23 24 25 |
# File 'lib/breezy_pdf/uploads/file_form_data.rb', line 23 def boundary @boundary ||= SecureRandom.hex end |
#data ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/breezy_pdf/uploads/file_form_data.rb', line 15 def data @data ||= [ field_data, file_data, closing_data ].join end |