Class: Net::HTTPResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/s33r/s33r_http.rb

Overview

Adds some convenience functions for checking response status.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#body=(value) ⇒ Object (writeonly)

Sets the attribute body

Parameters:

  • value

    the value to set the attribute body to.



8
9
10
# File 'lib/s33r/s33r_http.rb', line 8

def body=(value)
  @body = value
end

#successObject

Returns the value of attribute success.



7
8
9
# File 'lib/s33r/s33r_http.rb', line 7

def success
  @success
end

Instance Method Details

#not_foundObject



18
19
20
# File 'lib/s33r/s33r_http.rb', line 18

def not_found
  code = '404'
end

#ok?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/s33r/s33r_http.rb', line 10

def ok?
  success
end

#to_sObject



22
23
24
# File 'lib/s33r/s33r_http.rb', line 22

def to_s
  body
end