Class: Gem::Commands::InaboxCommand::Multipart::FileParam

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/commands/inabox_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(k, filename, content) ⇒ FileParam

Returns a new instance of FileParam.



132
133
134
135
136
# File 'lib/rubygems/commands/inabox_command.rb', line 132

def initialize( k, filename, content )
  @k = k
  @filename = filename
  @content = content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



131
132
133
# File 'lib/rubygems/commands/inabox_command.rb', line 131

def content
  @content
end

#filenameObject

Returns the value of attribute filename.



131
132
133
# File 'lib/rubygems/commands/inabox_command.rb', line 131

def filename
  @filename
end

#kObject

Returns the value of attribute k.



131
132
133
# File 'lib/rubygems/commands/inabox_command.rb', line 131

def k
  @k
end

Instance Method Details

#to_multipartObject



138
139
140
# File 'lib/rubygems/commands/inabox_command.rb', line 138

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