Class: Gem::Commands::InaboxsecureCommand::Multipart::FileParam
- Inherits:
-
Object
- Object
- Gem::Commands::InaboxsecureCommand::Multipart::FileParam
- Defined in:
- lib/rubygems/commands/inaboxsecure_command.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#k ⇒ Object
Returns the value of attribute k.
Instance Method Summary collapse
-
#initialize(k, filename, content) ⇒ FileParam
constructor
A new instance of FileParam.
- #to_multipart ⇒ Object
Constructor Details
#initialize(k, filename, content) ⇒ FileParam
Returns a new instance of FileParam.
134 135 136 137 138 |
# File 'lib/rubygems/commands/inaboxsecure_command.rb', line 134 def initialize( k, filename, content ) @k = k @filename = filename @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
133 134 135 |
# File 'lib/rubygems/commands/inaboxsecure_command.rb', line 133 def content @content end |
#filename ⇒ Object
Returns the value of attribute filename.
133 134 135 |
# File 'lib/rubygems/commands/inaboxsecure_command.rb', line 133 def filename @filename end |
#k ⇒ Object
Returns the value of attribute k.
133 134 135 |
# File 'lib/rubygems/commands/inaboxsecure_command.rb', line 133 def k @k end |
Instance Method Details
#to_multipart ⇒ Object
140 141 142 |
# File 'lib/rubygems/commands/inaboxsecure_command.rb', line 140 def to_multipart return "Content-Disposition: form-data; name=\"#{k}\"; filename=\"#{filename}\"\r\n" + "Content-Transfer-Encoding: binary\r\n" + "Content-Type: application/octet-stream\r\n\r\n" + content + "\r\n" end |