Class: Vantiv::Certification::PaypageServer

Inherits:
Object
  • Object
show all
Defined in:
lib/vantiv/certification/paypage_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(threaded: true) ⇒ PaypageServer

Returns a new instance of PaypageServer.



8
9
10
11
12
# File 'lib/vantiv/certification/paypage_server.rb', line 8

def initialize(threaded: true)
  @threaded = threaded
  @template = "#{Vantiv.root}/lib/vantiv/certification/views/index.html.erb"
  @static_file_dir = "#{Vantiv.root}/tmp/e-protect"
end

Instance Method Details

#root_pathObject



22
23
24
# File 'lib/vantiv/certification/paypage_server.rb', line 22

def root_path
  "http://localhost:#{port}"
end

#startObject



14
15
16
17
18
19
20
# File 'lib/vantiv/certification/paypage_server.rb', line 14

def start
  if threaded
    @server_thread = Thread.new { start_server }
  else
    start_server
  end
end

#stopObject



26
27
28
# File 'lib/vantiv/certification/paypage_server.rb', line 26

def stop
  threaded ? Thread.kill(server_thread) : stop_server
end