Class: BioDSL::Dump
- Inherits:
-
Object
- Object
- BioDSL::Dump
- Defined in:
- lib/BioDSL/commands/dump.rb
Overview
Dump records in stream to STDOUT.
dump
outputs records from the stream to STDOUT.
Usage
dump([first: <uint> |last: <uint>])
Options
-
first <uint> - Only dump the first number of records.
-
last <uint> - Only dump the last number of records.
Examples
To dump all records in the stream:
dump
To dump only the first 10 records:
dump(first: 10)
To dump only the last 10 records:
dump(last: 10)
Constant Summary collapse
- STATS =
%i(records_in records_out)
Instance Method Summary collapse
-
#initialize(options) ⇒ Dump
constructor
Constructor for the Dump class.
-
#lmb ⇒ Proc
Return a lambda for the dump command.
Constructor Details
#initialize(options) ⇒ Dump
Constructor for the Dump class.
65 66 67 68 69 |
# File 'lib/BioDSL/commands/dump.rb', line 65 def initialize() @options = end |
Instance Method Details
#lmb ⇒ Proc
Return a lambda for the dump command.
74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/BioDSL/commands/dump.rb', line 74 def lmb lambda do |input, output, status| status_init(status, STATS) if @options[:first] dump_first(input, output) elsif @options[:last] dump_last(input, output) else dump_all(input, output) end end end |