Class: Blitz::Curl::Sprint::Request

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

Overview

Represents the request object generated by the sprint. Contains all of the headers and POST/PUT data, if any.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Request

:nodoc:



25
26
27
28
29
30
31
# File 'lib/blitz/curl/sprint.rb', line 25

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

Instance Attribute Details

#contentObject (readonly)

POST/PUT content, if any



23
24
25
# File 'lib/blitz/curl/sprint.rb', line 23

def content
  @content
end

#headersObject (readonly)

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



20
21
22
# File 'lib/blitz/curl/sprint.rb', line 20

def headers
  @headers
end

#lineObject (readonly)

The entire request line (GET / HTTP/1.1, for example)



11
12
13
# File 'lib/blitz/curl/sprint.rb', line 11

def line
  @line
end

#methodObject (readonly)

The method used in the request



14
15
16
# File 'lib/blitz/curl/sprint.rb', line 14

def method
  @method
end

#urlObject (readonly)

The URL, including path, query arguments and hash fragments



17
18
19
# File 'lib/blitz/curl/sprint.rb', line 17

def url
  @url
end