Module Wrest::HttpCodes

  1. lib/wrest/http_codes.rb

Contains convenience methods to check HTTP response codes

Public instance methods

accepted? ()
[show source]
    # File lib/wrest/http_codes.rb, line 22
22:     def accepted?
23:       self.code.to_i == 202
24:     end
bad_request? ()
[show source]
    # File lib/wrest/http_codes.rb, line 50
50:     def bad_request?
51:       self.code.to_i == 400
52:     end
created? ()
[show source]
    # File lib/wrest/http_codes.rb, line 18
18:     def created?
19:       self.code.to_i == 201
20:     end
forbidden? ()
[show source]
    # File lib/wrest/http_codes.rb, line 58
58:     def forbidden?
59:       self.code.to_i == 403
60:     end
found? ()
[show source]
    # File lib/wrest/http_codes.rb, line 34
34:     def found?
35:       self.code.to_i == 302
36:     end
internal_server_error? ()
[show source]
    # File lib/wrest/http_codes.rb, line 78
78:     def internal_server_error?
79:       self.code.to_i == 500
80:     end
method_not_allowed? ()
[show source]
    # File lib/wrest/http_codes.rb, line 66
66:     def method_not_allowed?
67:       self.code.to_i == 405
68:     end
moved_permanently? ()
[show source]
    # File lib/wrest/http_codes.rb, line 30
30:     def moved_permanently?
31:       self.code.to_i == 301
32:     end
no_content? ()
[show source]
    # File lib/wrest/http_codes.rb, line 26
26:     def no_content?
27:       self.code.to_i == 204
28:     end
not_acceptable? ()
[show source]
    # File lib/wrest/http_codes.rb, line 70
70:     def not_acceptable?
71:       self.code.to_i == 406
72:     end
not_found? ()
[show source]
    # File lib/wrest/http_codes.rb, line 62
62:     def not_found?
63:       self.code.to_i == 404
64:     end
not_modified? ()
[show source]
    # File lib/wrest/http_codes.rb, line 42
42:     def not_modified?
43:       self.code.to_i == 304
44:     end
ok? ()
[show source]
    # File lib/wrest/http_codes.rb, line 14
14:     def ok?
15:       self.code.to_i == 200
16:     end
see_other? ()
[show source]
    # File lib/wrest/http_codes.rb, line 38
38:     def see_other?
39:       self.code.to_i == 303
40:     end
temporary_redirect? ()
[show source]
    # File lib/wrest/http_codes.rb, line 46
46:     def temporary_redirect?
47:       self.code.to_i == 307
48:     end
unauthorized? ()
[show source]
    # File lib/wrest/http_codes.rb, line 54
54:     def unauthorized?
55:       self.code.to_i == 401
56:     end
unprocessable_entity? ()
[show source]
    # File lib/wrest/http_codes.rb, line 74
74:     def unprocessable_entity?
75:       self.code.to_i == 422
76:     end