Class: Cript::HidrCommand
- Inherits:
-
Object
- Object
- Cript::HidrCommand
- Defined in:
- lib/cript/hidr_command.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(argv) ⇒ HidrCommand
constructor
A new instance of HidrCommand.
- #run! ⇒ Object
Constructor Details
#initialize(argv) ⇒ HidrCommand
Returns a new instance of HidrCommand.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cript/hidr_command.rb', line 9 def initialize(argv) @argv = argv.dup = { mode: nil, infile: '-', outfile: '-', force: false, b0: '0', b1: '1', debug: false } parse! end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/cript/hidr_command.rb', line 7 def end |
Instance Method Details
#run! ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cript/hidr_command.rb', line 25 def run! validate_mode hidr = build_hidr data = read_data get_writer do |writer| if [:mode] == 'hide' writer.print hidr.hide(data) else writer.print hidr.show(data) end end end |