Class: Bcdatabase::Commands::GenKey
- Inherits:
-
Object
- Object
- Bcdatabase::Commands::GenKey
- Defined in:
- lib/bcdatabase/commands/gen_key.rb
Instance Method Summary collapse
-
#initialize(streaming) ⇒ GenKey
constructor
A new instance of GenKey.
- #run ⇒ Object
Constructor Details
#initialize(streaming) ⇒ GenKey
Returns a new instance of GenKey.
7 8 9 10 |
# File 'lib/bcdatabase/commands/gen_key.rb', line 7 def initialize(streaming) @streaming = streaming @hl = HighLine.new($stdin, $stderr) end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/bcdatabase/commands/gen_key.rb', line 12 def run begin key = random_key(128) outio.write key ensure @outio.close if @close_out && @outio end end |