Class: RailsHttpLab::Execution::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails_http_lab/execution/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def body
  @body
end

#duration_msObject

Returns the value of attribute duration_ms

Returns:

  • (Object)

    the current value of duration_ms



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def duration_ms
  @duration_ms
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def error
  @error
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def headers
  @headers
end

#requestObject

Returns the value of attribute request

Returns:

  • (Object)

    the current value of request



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def request
  @request
end

#size_bytesObject

Returns the value of attribute size_bytes

Returns:

  • (Object)

    the current value of size_bytes



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def size_bytes
  @size_bytes
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



3
4
5
# File 'lib/rails_http_lab/execution/response.rb', line 3

def status
  @status
end

Instance Method Details

#to_hObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rails_http_lab/execution/response.rb', line 7

def to_h
  {
    status:      status,
    headers:     headers,
    body:        body,
    duration_ms: duration_ms,
    size_bytes:  size_bytes,
    error:       error,
    request:     request
  }
end