Class: TestServer::StringController

Inherits:
ApplicationController show all
Defined in:
app/controllers/test_server/string_controller.rb

Instance Method Summary collapse

Methods included from WebHelper

#configure_caching, #encode, #generate_eicar, #generate_random_string, #generate_string

Instance Method Details

#eicarObject



13
14
15
# File 'app/controllers/test_server/string_controller.rb', line 13

def eicar
  render text: encode(params) { generate_eicar.join }
end

#indexObject



4
5
6
7
# File 'app/controllers/test_server/string_controller.rb', line 4

def index
  add_breadcrumb I18n.t('views.root.link'), :root_path
  add_breadcrumb I18n.t('views.string.link'), :string_path
end

#plainObject



9
10
11
# File 'app/controllers/test_server/string_controller.rb', line 9

def plain
  render text: encode(params) { generate_string(params[:count]) }
end

#randomObject



23
24
25
# File 'app/controllers/test_server/string_controller.rb', line 23

def random
  render text: encode(params) { generate_random_string(params[:count]) }
end

#sleepObject



17
18
19
20
21
# File 'app/controllers/test_server/string_controller.rb', line 17

def sleep
  Kernel.sleep params[:count].to_i

  render text: encode(params) { generate_string(1) }
end