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 (collapse)
-
- (SymbolHash) options
inherited
from Base
readonly
All serializer options are saved so they can be passed to other serializers.
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.
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 Attribute Details
- (SymbolHash) options (readonly) Originally defined in class Base
All serializer options are saved so they can be passed to other serializers.
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 |