Class: Secure::ParentProcess

Inherits:
Object
  • Object
show all
Defined in:
lib/secure/parent_process.rb

Instance Method Summary collapse

Constructor Details

#initialize(read_file, write_file) ⇒ ParentProcess

Returns a new instance of ParentProcess.



5
6
7
8
# File 'lib/secure/parent_process.rb', line 5

def initialize(read_file, write_file)
  @pipe = read_file
  write_file.close
end

Instance Method Details

#executeObject



10
11
12
13
14
# File 'lib/secure/parent_process.rb', line 10

def execute
  Marshal.load(Base64.decode64(@pipe.read))
rescue
  Response.error(ChildKilledError.new("Child has been killed without returning"))
end