Module: HttpStub::Server::Application::RequestSupport

Included in:
Application
Defined in:
lib/http_stub/server/application/request_support.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#http_stub_requestObject (readonly)

Returns the value of attribute http_stub_request


11
12
13
# File 'lib/http_stub/server/application/request_support.rb', line 11

def http_stub_request
  @http_stub_request
end

Class Method Details

.included(application) ⇒ Object


22
23
24
25
26
27
28
29
30
31
32
# File 'lib/http_stub/server/application/request_support.rb', line 22

def self.included(application)
  application.instance_eval do

    def self.any_request_method(path, opts={}, &block)
      STUBBABLE_REQUEST_METHODS.each { |request_method| self.send(request_method, path, opts, &block) }
    end

    before { establish_http_stub_request }

  end
end

Instance Method Details

#establish_http_stub_requestObject


18
19
20
# File 'lib/http_stub/server/application/request_support.rb', line 18

def establish_http_stub_request
  @http_stub_request = @request_factory.create(request, params, logger)
end

#initializeObject


13
14
15
16
# File 'lib/http_stub/server/application/request_support.rb', line 13

def initialize
  super()
  @request_factory = HttpStub::Server::Request::Factory.new(settings.session_identifier, @server_memory)
end