Class: TrustedSandbox::RequestSerializer
- Inherits:
-
Object
- Object
- TrustedSandbox::RequestSerializer
- Defined in:
- lib/trusted_sandbox/request_serializer.rb
Instance Attribute Summary collapse
-
#host_code_dir_path ⇒ Object
readonly
Returns the value of attribute host_code_dir_path.
-
#input_file_name ⇒ Object
readonly
Returns the value of attribute input_file_name.
-
#manifest_file_name ⇒ Object
readonly
Returns the value of attribute manifest_file_name.
Instance Method Summary collapse
-
#initialize(host_code_dir_path, manifest_file_name, input_file_name) ⇒ RequestSerializer
constructor
A new instance of RequestSerializer.
-
#serialize(klass, *args) ⇒ String
Full path of the argument that was stored.
Constructor Details
#initialize(host_code_dir_path, manifest_file_name, input_file_name) ⇒ RequestSerializer
Returns a new instance of RequestSerializer.
9 10 11 12 13 |
# File 'lib/trusted_sandbox/request_serializer.rb', line 9 def initialize(host_code_dir_path, manifest_file_name, input_file_name) @host_code_dir_path = host_code_dir_path @input_file_name = input_file_name @manifest_file_name = manifest_file_name end |
Instance Attribute Details
#host_code_dir_path ⇒ Object (readonly)
Returns the value of attribute host_code_dir_path.
4 5 6 |
# File 'lib/trusted_sandbox/request_serializer.rb', line 4 def host_code_dir_path @host_code_dir_path end |
#input_file_name ⇒ Object (readonly)
Returns the value of attribute input_file_name.
4 5 6 |
# File 'lib/trusted_sandbox/request_serializer.rb', line 4 def input_file_name @input_file_name end |
#manifest_file_name ⇒ Object (readonly)
Returns the value of attribute manifest_file_name.
4 5 6 |
# File 'lib/trusted_sandbox/request_serializer.rb', line 4 def manifest_file_name @manifest_file_name end |
Instance Method Details
#serialize(klass, *args) ⇒ String
Returns full path of the argument that was stored.
18 19 20 21 22 23 24 25 |
# File 'lib/trusted_sandbox/request_serializer.rb', line 18 def serialize(klass, *args) self.klass = klass copy_code_file create_manifest_file data = Marshal.dump([klass.name, args]) File.binwrite input_file_path, data end |