Class: Tempest::HTTP::Response

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



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

def body
  @body
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/tempest/http.rb', line 16

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

#unauthorized?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/tempest/http.rb', line 20

def unauthorized?
  status == 401
end