Class: Richard::Internal::CurlFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/richard_iii/internal/curl.rb

Class Method Summary collapse

Class Method Details

.as_string(reply) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/richard_iii/internal/curl.rb', line 46

def as_string(reply)
  return '' if reply.nil?
  CurlReply.new((
    ["HTTP/1.1 #{reply.status}"] + 
    headers_from(reply) + 
    ["\n#{reply.body.strip}\n"]
  ).join("\n"))
end