Class: Merb::Test::MultipartRequestHelper::Param
- Defined in:
- lib/merb-core/test/helpers/multipart_request_helper.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ Param
constructor
Parameters key<~to_s>:: The parameter key.
-
#to_multipart ⇒ Object
Returns String:: The parameter in a form suitable for a multipart request.
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
#key ⇒ Object
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 |
#value ⇒ Object
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_multipart ⇒ Object
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 |