Class: Mimic::API

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/mimic/api.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/mimic/api.rb', line 8

def host
  @host
end

Instance Method Details

#hostObject



11
12
13
# File 'lib/mimic/api.rb', line 11

def host
  self.class.host
end

#process_request(request, verb) ⇒ Object



59
60
61
62
63
# File 'lib/mimic/api.rb', line 59

def process_request request, verb
  api_request = APIRequest.from_request(request, verb)
  api_request.setup_stubs_on(host)
  [201, {"Content-Type" => api_request.request_content_type}, api_request.response]
end