@@ -98,17 +98,18 @@ module IO {
98
98
99
99
/**
100
100
* A `DataFlow::CallNode` that reads data using the `IO` class. For example,
101
- * the `IO. read call in:
101
+ * the `read` and `readline` calls in:
102
102
*
103
103
* ```rb
104
+ * # invokes the `date` shell command as a subprocess, returning its output as a string
104
105
* IO.read("|date")
105
- * ```
106
106
*
107
- * returns the output of the `date` shell command, invoked as a subprocess.
107
+ * # reads from the file `foo.txt`, returning its first line as a string
108
+ * IO.new(IO.sysopen("foo.txt")).readline
109
+ * ```
108
110
*
109
- * This class includes reads both from shell commands and reads from the
110
- * filesystem. For working with filesystem accesses specifically, see
111
- * `FileReader` or the `FileSystemReadAccess` concept.
111
+ * This class includes only reads that use the `IO` class directly, not those
112
+ * that use a subclass of `IO` such as `File`.
112
113
*/
113
114
class IOReader extends DataFlow:: CallNode {
114
115
private string receiverKind ;
@@ -135,13 +136,15 @@ module IO {
135
136
136
137
/**
137
138
* A `DataFlow::CallNode` that reads data from the filesystem using the `IO`
138
- * or `File` classes. For example, the `IO.read` call in:
139
+ * or `File` classes. For example, the `IO.read` and `File#readline` calls in:
139
140
*
140
141
* ```rb
142
+ * # reads the file `foo.txt` and returns its contents as a string.
141
143
* IO.read("foo.txt")
142
- * ```
143
144
*
144
- * reads the file `foo.txt` and returns its contents as a string.
145
+ * # reads from the file `foo.txt`, returning its first line as a string
146
+ * File.new("foo.txt").readline
147
+ * ```
145
148
*/
146
149
class FileReader extends DataFlow:: CallNode , FileSystemReadAccess:: Range {
147
150
private string receiverKind ;
0 commit comments