241件ヒット
[1-100件を表示]
(0.107秒)
別のキーワード
クラス
-
ARGF
. class (66) - Array (33)
-
File
:: Stat (22) - IO (55)
- Integer (43)
- Object (11)
モジュール
- Enumerable (11)
キーワード
- <=> (11)
- [] (21)
- chunk (11)
-
each
_ codepoint (22) - fetch (33)
-
initialize
_ copy (11) -
inplace
_ mode (11) -
inplace
_ mode= (11) - printf (22)
- reopen (33)
- size? (11)
- upto (22)
検索結果
先頭5件
-
IO
# print(*arg) -> nil (24322.0) -
引数を IO ポートに順に出力します。引数を省略した場合は、$_ を出力します。
...@param arg Kernel.#print と同じです。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
//emlist[例][ruby]{
$stdout.print("This is ", 100, " percent.\n") # => This is 100 per......cent.
//}
@see Kernel.#print... -
ARGF
. class # print(*arg) -> nil (24310.0) -
引数を順に処理対象のファイルに出力します。
...引数を順に処理対象のファイルに出力します。
c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は Kernel.#print と同じです。
@param arg 出力するオブジェクトを任意個指定します。... -
IO
# printf(format , *arg) -> nil (12309.0) -
C 言語の printf と同じように、format に従い引数 を文字列に変換して、self に出力します。
...の printf と同じように、format に従い引数
を文字列に変換して、self に出力します。
第一引数に IO を指定できないこと、引数を省略できないことを除けば Kernel.#printf と同じです。
@param format Kernel.#printf と同じです。print_form......at を参照してください。
@param arg Kernel.#printf と同じです。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
@see Kernel.#printf... -
ARGF
. class # printf(format , *arg) -> nil (12303.0) -
C 言語の printf と同じように、format に従い引数を 文字列に変換して処理対象のファイルに出力します。
... printf と同じように、format に従い引数を
文字列に変換して処理対象のファイルに出力します。
c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は出力先を指定しない形式の Kernel.#print......f と同じです。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。... -
ARGF
. class # inplace _ mode -> String | nil (6227.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や......ARGF.class#inplace_mode= で設定します。
例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"
# test.rb
ARGF.inplace_mode # => ".bak"
ARGF.each_line {|e|print e.upcase} # => "TEST"
例......:
# $ echo "test" > test.txt
# $ ruby test.rb test.txt
# $ cat test.txt # => "test"
# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=... -
Object
# initialize _ copy(obj) -> object (6221.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...ます。ただ
し、self のインスタンス変数や特異メソッドは変化しません。
Object#clone, Object#dupの内部で使われています。
initialize_copy は、Ruby インタプリタが知り得ない情報をコピーするた
めに使用(定義)されます。例えば C......lize_copy でコピーするよう定義しておくことで、dup や clone
を再定義する必要がなくなります。
デフォルトの Object#initialize_copy は、 freeze チェックおよび型のチェックを行い self
を返すだけのメソッドです。
initialize_copy と......のメソッドは
自動的に private に設定されます。
@raise TypeError レシーバが freeze されているか、obj のクラスがレシーバ
のクラスと異なる場合に発生します。
@see Object#clone,Object#dup
以下に例として、dup や clone がこのメソッ... -
ARGF
. class # each _ codepoint -> Enumerator (6209.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...す。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,105,110,101,50,10,... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (6209.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...す。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108,105,110,101,50,10,... -
IO
# reopen(path) -> self (6209.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...
path で指定されたファイルにストリームを繋ぎ換えます。
第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パ.......print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}
@see Kernel.#ope... -
IO
# reopen(path , mode) -> self (6209.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...
path で指定されたファイルにストリームを繋ぎ換えます。
第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パ.......print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}
@see Kernel.#ope...