Class: Translatomatic::HTTPRequest::Param

Inherits:
Object
  • Object
show all
Defined in:
lib/translatomatic/http_request.rb

Overview

Formats a basic string key/value pair for a multipart post

Direct Known Subclasses

FileParam

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, value:) ⇒ Param

Returns a new instance of Param.



68
69
70
71
# File 'lib/translatomatic/http_request.rb', line 68

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

Instance Attribute Details

#keyObject

Returns the value of attribute key.



66
67
68
# File 'lib/translatomatic/http_request.rb', line 66

def key
  @key
end

#valueObject

Returns the value of attribute value.



66
67
68
# File 'lib/translatomatic/http_request.rb', line 66

def value
  @value
end

Instance Method Details

#to_sObject



73
74
75
# File 'lib/translatomatic/http_request.rb', line 73

def to_s
  return header(header_data) + "\r\n#{value}\r\n"
end