Class: Evoke::HTTMockParty::Responder
- Inherits:
-
Object
- Object
- Evoke::HTTMockParty::Responder
- Defined in:
- lib/evoke_client/mock.rb
Instance Method Summary collapse
- #created ⇒ Object
- #internal_server_error ⇒ Object
- #not_found ⇒ Object
- #ok ⇒ Object
- #process ⇒ Object
- #responds(delegate, body = "", code = nil, message = nil, headers = {}) ⇒ Object
- #unprocessable_entity ⇒ Object
Instance Method Details
#created ⇒ Object
56 |
# File 'lib/evoke_client/mock.rb', line 56 def created; status(201, "Created"); end |
#internal_server_error ⇒ Object
59 |
# File 'lib/evoke_client/mock.rb', line 59 def internal_server_error; status(500, "Internal Server Error"); end |
#not_found ⇒ Object
57 |
# File 'lib/evoke_client/mock.rb', line 57 def not_found; status(404, "Not Found"); end |
#ok ⇒ Object
55 |
# File 'lib/evoke_client/mock.rb', line 55 def ok; status(200, "Ok"); end |
#process ⇒ Object
51 52 53 |
# File 'lib/evoke_client/mock.rb', line 51 def process HTTParty::Response.new(@delegate || "", @body, @code, @message, @headers) end |
#responds(delegate, body = "", code = nil, message = nil, headers = {}) ⇒ Object
61 62 63 64 |
# File 'lib/evoke_client/mock.rb', line 61 def responds(delegate, body="", code=nil, =nil, headers={}) @delegate, @body, @code, @message, @headers = delegate, body, code, , headers self end |
#unprocessable_entity ⇒ Object
58 |
# File 'lib/evoke_client/mock.rb', line 58 def unprocessable_entity; status(422, "Unprocessable Entity"); end |