Module: Restfulie::Client::HTTP::ResponseStatus

Included in:
Net::HTTPResponse
Defined in:
lib/restfulie/client/cache/http_ext.rb

Overview

an extesion to http responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#previousObject

Returns the value of attribute previous.



6
7
8
# File 'lib/restfulie/client/cache/http_ext.rb', line 6

def previous
  @previous
end

Instance Method Details

#etagObject



33
34
35
# File 'lib/restfulie/client/cache/http_ext.rb', line 33

def etag
  self['Etag']
end

#is_client_error?Boolean

determines if this response code was successful (according to http specs: 400~499)

Returns:

  • (Boolean)


24
25
26
# File 'lib/restfulie/client/cache/http_ext.rb', line 24

def is_client_error?
  code.to_i >= 400 && code.to_i <= 499
end

#is_informational?Boolean

determines if this response code was successful (according to http specs: 100~199)

Returns:

  • (Boolean)


14
15
16
# File 'lib/restfulie/client/cache/http_ext.rb', line 14

def is_informational?
  code.to_i >= 100 && code.to_i <= 199
end

#is_redirection?Boolean

determines if this response code was successful (according to http specs: 300~399)

Returns:

  • (Boolean)


19
20
21
# File 'lib/restfulie/client/cache/http_ext.rb', line 19

def is_redirection?
  code.to_i >= 300 && code.to_i <= 399
end

#is_server_error?Boolean

determines if this response code was successful (according to http specs: 500~599)

Returns:

  • (Boolean)


29
30
31
# File 'lib/restfulie/client/cache/http_ext.rb', line 29

def is_server_error?
  code.to_i >= 500 && code.to_i <= 599
end

#is_successful?Boolean

determines if this response code was successful (according to http specs: 200~299)

Returns:

  • (Boolean)


9
10
11
# File 'lib/restfulie/client/cache/http_ext.rb', line 9

def is_successful?
  code.to_i >= 200 && code.to_i <= 299
end

#last_modifiedObject



37
38
39
# File 'lib/restfulie/client/cache/http_ext.rb', line 37

def last_modified
  self['Last-Modified']
end