Parent

Class Index [+]

Quicksearch

Merb::Test::MultipartRequestHelper::FileParam

Attributes

key[RW]
filename[RW]
content[RW]

Public Class Methods

new(key, filename, content) click to toggle source

Parameters

key<~to_s>

The parameter key.

filename<~to_s>

Name of the file for this parameter.

content<~to_s>

Content of the file for this parameter.

    # File lib/merb-core/test/helpers/multipart_request_helper.rb, line 30
30:     def initialize(key, filename, content)
31:       @key      = key
32:       @filename = filename
33:       @content  = content
34:     end

Public Instance Methods

to_multipart() click to toggle source

Returns

String

The file parameter in a form suitable for a multipart request.

    # File lib/merb-core/test/helpers/multipart_request_helper.rb, line 39
39:     def to_multipart
40:       return %(Content-Disposition: form-data; name="#{key}"; filename="#{filename}"\r\n) + "Content-Type: #{MIME::Types.type_for(@filename).first}\r\n\r\n" + content + "\r\n"
41:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.