Class: YARD::Serializers::ProcessSerializer
- Inherits:
-
Base
- Object
- Base
- YARD::Serializers::ProcessSerializer
- Defined in:
- lib/yard/serializers/process_serializer.rb
Overview
Serializes an object to a process (like less)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (ProcessSerializer) initialize(cmd)
constructor
Creates a new ProcessSerializer for the shell command cmd.
-
- (Object) serialize(object, data)
Overrides serialize behaviour and writes data to standard input of the associated command.
Methods inherited from Base
#after_serialize, #before_serialize, #exists?, #serialized_path
Constructor Details
- (ProcessSerializer) initialize(cmd)
Creates a new ProcessSerializer for the shell command cmd
12 13 14 |
# File 'lib/yard/serializers/process_serializer.rb', line 12 def initialize(cmd) @cmd = cmd end |
Instance Method Details
- (Object) serialize(object, data)
Overrides serialize behaviour and writes data to standard input of the associated command
18 19 20 |
# File 'lib/yard/serializers/process_serializer.rb', line 18 def serialize(object, data) IO.popen(@cmd, 'w') {|io| io.write(data) } end |