Class: Texd::Attachment::Dynamic
- Inherits:
-
Struct
- Object
- Struct
- Texd::Attachment::Dynamic
- Defined in:
- lib/texd/attachment.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#name(with_extension = true) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter.
Instance Method Summary collapse
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents
177 178 179 |
# File 'lib/texd/attachment.rb', line 177 def contents @contents end |
#name(with_extension = true) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter
184 185 186 |
# File 'lib/texd/attachment.rb', line 184 def name @name end |
Instance Method Details
#to_upload_io ⇒ Object
178 179 180 181 182 |
# File 'lib/texd/attachment.rb', line 178 def to_upload_io(**) Multipart::Post::UploadIO.new(StringIO.new(contents), nil, name).tap { |io| io.instance_variable_set :@original_filename, name } end |