[ruby/io-console] [DOC] IO::console.getpass usage example

There were no clear example of this very useful method's usage anywhere
in the IO or IO::Console docs, which was a shame.

https://github.com/ruby/io-console/commit/4d324586a8
This commit is contained in:
Olivier Lacan 2023-08-17 17:28:16 -07:00 committed by git
parent ad2bad4ab4
commit 43802a088e

View File

@ -1578,6 +1578,12 @@ str_chomp(VALUE str)
* see String#chomp!.
*
* You must require 'io/console' to use this method.
*
* require 'io/console'
* IO::console.getpass("Enter password: ")
* Enter password:
* # => "mypassword"
*
*/
static VALUE
console_getpass(int argc, VALUE *argv, VALUE io)