Class: Blitz::Curl::Sprint::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/blitz/curl/sprint.rb

Overview

Represents the response object generated by the sprint. Contains all of the headers and the response payload, if any.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Response

:nodoc:



52
53
54
55
56
57
58
# File 'lib/blitz/curl/sprint.rb', line 52

def initialize json # :nodoc:
    @line = json['line']
    @status = json['status']
    @message = json['message']
    @content = json['content'].unpack('m')[0]
    @headers = json['headers']
end

Instance Attribute Details

#contentObject (readonly)

The response content, if any



50
51
52
# File 'lib/blitz/curl/sprint.rb', line 50

def content
  @content
end

#headersObject (readonly)

All of the response headers (as a Hash of name/value pairs)



47
48
49
# File 'lib/blitz/curl/sprint.rb', line 47

def headers
  @headers
end

#lineObject (readonly)

The entire response line (HTTP/1.1 200 Okay, for example)



38
39
40
# File 'lib/blitz/curl/sprint.rb', line 38

def line
  @line
end

#messageObject (readonly)

The message in the response line



44
45
46
# File 'lib/blitz/curl/sprint.rb', line 44

def message
  @message
end

#statusObject (readonly)

The response status



41
42
43
# File 'lib/blitz/curl/sprint.rb', line 41

def status
  @status
end