Class: Async::HTTP::Protocol::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/async/http/protocol/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



24
25
26
# File 'lib/async/http/protocol/response.rb', line 24

def body
  @body
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



24
25
26
# File 'lib/async/http/protocol/response.rb', line 24

def headers
  @headers
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



24
25
26
# File 'lib/async/http/protocol/response.rb', line 24

def reason
  @reason
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



24
25
26
# File 'lib/async/http/protocol/response.rb', line 24

def status
  @status
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



24
25
26
# File 'lib/async/http/protocol/response.rb', line 24

def version
  @version
end

Instance Method Details

#continue?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/async/http/protocol/response.rb', line 25

def continue?
	status == 100
end

#failure?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/async/http/protocol/response.rb', line 37

def failure?
	status >= 400 && status < 600
end

#redirection?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/async/http/protocol/response.rb', line 33

def redirection?
	status >= 300 && status < 400
end

#success?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/async/http/protocol/response.rb', line 29

def success?
	status >= 200 && status < 300
end