Class: Merb::Test::MultipartRequestHelper::Param

Inherits:
Object
  • Object
show all
Defined in:
lib/merb-core/test/helpers/multipart_request_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Param

Parameters

key<~to_s>

The parameter key.

value<~to_s>

The parameter value.



11
12
13
14
# File 'lib/merb-core/test/helpers/multipart_request_helper.rb', line 11

def initialize(key, value)
  @key   = key
  @value = value
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/merb-core/test/helpers/multipart_request_helper.rb', line 6

def key
  @key
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/merb-core/test/helpers/multipart_request_helper.rb', line 6

def value
  @value
end

Instance Method Details

#to_multipartObject

Returns

String

The parameter in a form suitable for a multipart request.



18
19
20
# File 'lib/merb-core/test/helpers/multipart_request_helper.rb', line 18

def to_multipart
  return %(Content-Disposition: form-data; name="#{key}"\r\n\r\n#{value}\r\n)
end