Class: Keycardai::OAuth::HTTP::Response

Inherits:
Data
  • Object
show all
Defined in:
lib/keycardai/oauth/http.rb

Overview

A minimal HTTP response: numeric status, header hash, body string.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



15
16
17
# File 'lib/keycardai/oauth/http.rb', line 15

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



15
16
17
# File 'lib/keycardai/oauth/http.rb', line 15

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



15
16
17
# File 'lib/keycardai/oauth/http.rb', line 15

def status
  @status
end

Instance Method Details

#success?Boolean

Returns whether the status is 2xx.

Returns:

  • (Boolean)

    whether the status is 2xx



17
18
19
# File 'lib/keycardai/oauth/http.rb', line 17

def success?
  (200..299).cover?(status)
end