Class: MessageExchange::Get
Instance Attribute Summary
Attributes inherited from Request
#params, #uri
Instance Method Summary
collapse
Methods inherited from Request
#http, #initialize, #port, #response
Instance Method Details
#full_path ⇒ Object
9
10
11
|
# File 'lib/message_exchange/get.rb', line 9
def full_path
"#{uri.request_uri}#{parameter_string}"
end
|
#parameter_string ⇒ Object
13
14
15
16
|
# File 'lib/message_exchange/get.rb', line 13
def parameter_string
return ("?" + params.to_query) unless params.empty?
""
end
|
#request ⇒ Object
3
4
5
6
7
|
# File 'lib/message_exchange/get.rb', line 3
def request
Net::HTTP::Get.new(full_path).tap do |request|
request['Accept'] = 'application/json'
end
end
|