Class: Evoke::HTTMockParty::Responder

Inherits:
Object
  • Object
show all
Defined in:
lib/evoke_client/mock.rb

Instance Method Summary collapse

Instance Method Details

#createdObject



56
# File 'lib/evoke_client/mock.rb', line 56

def created; status(201, "Created"); end

#internal_server_errorObject



59
# File 'lib/evoke_client/mock.rb', line 59

def internal_server_error; status(500, "Internal Server Error"); end

#not_foundObject



57
# File 'lib/evoke_client/mock.rb', line 57

def not_found; status(404, "Not Found"); end

#okObject



55
# File 'lib/evoke_client/mock.rb', line 55

def ok; status(200, "Ok"); end

#processObject



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, message=nil, headers={})
  @delegate, @body, @code, @message, @headers = delegate, body, code, message, headers
  self
end

#unprocessable_entityObject



58
# File 'lib/evoke_client/mock.rb', line 58

def unprocessable_entity; status(422, "Unprocessable Entity"); end