Class: Evoke::HTTMockParty::Router

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

Instance Method Summary collapse

Constructor Details

#initializeRouter

Returns a new instance of Router.



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

def initialize; @responder_routes = {}; end

Instance Method Details

#dispatch(*args) ⇒ Object



41
42
43
# File 'lib/evoke_client/mock.rb', line 41

def dispatch(*args)
  (@responder_routes[args.inspect] || NilResponder).process
end

#maps(*args) ⇒ Object



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

def maps(*args) @responder_routes[args.inspect] = Responder.new; end