Ruby: IO

作者: bookinstock_ | 来源:发表于2017-04-21 08:07 被阅读4次

intro

  • program use IO to interact with outside world.

standard io

  • ruby defines standard io constant: STDIN, STDOUT, STDERR
  • they are same as global variables: $stdin, $stdout, $stderr
  • which pointing to program's input, output and error streams.
  • you can play with it through your terminal simply.
  • method 'gets' capture STDIN string.
  • method 'puts' to sent STDOUT string.
  • method 'warn' to direct to STDERR string.

相关文章

网友评论

      本文标题:Ruby: IO

      本文链接:https://www.haomeiwen.com/subject/qjgrzttx.html