class Hyperion::FakeServer::Config

Public Instance Methods

allow(*args, &handler) click to toggle source

allow(route) allow(method, path, headers={})

# File lib/hyperion_test/fake_server/config.rb, line 15
def allow(*args, &handler)
  rule = allowed_rule(args, handler)
  rules << rule
  log_stub(rule)
end
rules() click to toggle source
# File lib/hyperion_test/fake_server/config.rb, line 9
def rules
  @rules ||= []
end

Private Instance Methods

allowed_rule(args, handler) click to toggle source
# File lib/hyperion_test/fake_server/config.rb, line 23
def allowed_rule(args, handler)
  if args.size == 1 && args.first.is_a?(RestRoute)
    route = args.first
    Rule.new(route.method, route.uri.path, route_headers(route), handler, route)
  else
    method, path, headers = args
    headers ||= {}
    Rule.new(method, path, headers, handler, nil)
  end
end