Class: Iudex::HTTP::Test::TestApp

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/iudex-http-test/test_app.rb

Defined Under Namespace

Classes: GiantGenerator, SlowGenerator

Constant Summary collapse

PUBLIC =
File.expand_path( File.join( File.dirname( __FILE__ ),
'..', '..', 'public' ) )
@@counter =
ConcurrentCounter.new

Instance Method Summary collapse

Instance Method Details

#common(params) ⇒ Object



205
206
207
208
209
210
211
# File 'lib/iudex-http-test/test_app.rb', line 205

def common( params )
  ps = [ :sleep, :con ].
    map { |k| ( v = params[k] ) && [ k, v ] }.
    compact.
    map { |k,v| [ k, CGI.escape( v.to_s ) ].join( '=' ) }
  '?' + ps.join( '&' ) unless ps.empty?
end