22件ヒット
[1-22件を表示]
(0.033秒)
別のキーワード
キーワード
-
$ ERROR _ POSITION (11) -
$ stdin (11)
検索結果
-
Kernel
$ $ ERROR _ POSITION -> [String] | nil (12201.0) -
$@ の別名
...$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end... -
Kernel
$ $ stdin -> object (19.0) -
標準入力です。
...# 入力する
$stdin = STDIN # 元に戻す
//}
ただし、Kernel.#gets など、特定の組み込みメソッドは
$stdin オブジェクトにメソッドを転送して実装されています。
従って、Kernel.#gets などが正しく動作するには、
$stdin オブジェク......のメソッドを
正しく実装していなければいけません。
gets, readline, readlines, getc, readchar, tell, seek,
pos=, rewind, fileno, to_io, eof, each_line, each_byte,
binmode, closed?
//emlist[例][ruby]{
$stdin = Object.new
def $stdin.gets
"foo"
end
p gets() # =>...