48件ヒット
[1-48件を表示]
(0.136秒)
別のキーワード
オブジェクト
-
Readline
:: HISTORY (22)
キーワード
- IO (11)
-
NEWS for Ruby 3
. 0 . 0 (4) - 制御構造 (11)
検索結果
先頭5件
-
Readline
:: HISTORY . length -> Integer (21208.0) -
ヒストリに格納された内容の数を取得します。
...ヒストリに格納された内容の数を取得します。
例: ヒストリの内容を最初から順番に出力する。
require "readline"
Readline::HISTORY.push("foo", "bar", "baz")
p Readline::HISTORY.length #=> 3
@see Readline::HISTORY.empty?... -
Readline
:: HISTORY . size -> Integer (21208.0) -
ヒストリに格納された内容の数を取得します。
...ヒストリに格納された内容の数を取得します。
例: ヒストリの内容を最初から順番に出力する。
require "readline"
Readline::HISTORY.push("foo", "bar", "baz")
p Readline::HISTORY.length #=> 3
@see Readline::HISTORY.empty?... -
NEWS for Ruby 3
. 0 . 0 (342.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in`......`PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core cl......per-`Thread`. This change should be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc
* Proc#== and Proc#eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQue... -
IO (120.0)
-
基本的な入出力機能のためのクラスです。
...IO.readlines
* IO#each_line
* IO#lines
* IO#gets
* IO#getc
* IO#ungetc
* IO#read
* IO#readchar
* IO#readline
* IO#readlines
バイナリ読み込みメソッドは IO のエンコーディングの影響を受けません。
返す文字列のエンコーディングは常に ASCII-8BIT......になります。
以下がバイナリ読み込みメソッドです。
* IO#read(size)
* IO#read_nonblock
* IO#readpartial
* IO#sysread
また書き込みメソッド IO#write も IO のエンコーディングの影響を受けます。
IO のすべての書き込みメソッドは内部......い
空ファイルや EOF での各読み込みメソッドの振る舞いは以下のとおりです。
ただし、length を指定できるメソッドに関しては、length に nil または 0 を指定した場合、
EOF であっても常に空文字列 "" を返します。
//emlist{
メ......ch
* IO.readlines
* IO#each_line
* IO#gets
* IO#getc
* IO#ungetc
* IO#read
* IO#readchar
* IO#readline
* IO#readlines
バイナリ読み込みメソッドは IO のエンコーディングの影響を受けません。
返す文字列のエンコーディングは常に ASCII-8BIT にな......ります。
以下がバイナリ読み込みメソッドです。
* IO#read(size)
* IO#read_nonblock
* IO#readpartial
* IO#sysread
また書き込みメソッド IO#write も IO のエンコーディングの影響を受けます。
IO のすべての書き込みメソッドは内部で IO#... -
制御構造 (54.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...明しています。
=== 繰り返し
====[a:while] while
//emlist[例][ruby]{
ary = [0,2,4,8,16,32,64,128,256,512,1024]
i = 0
while i < ary.length
print ary[i]
i += 1
end
//}
文法:
while 式 [do]
...
end
式を評価した値が真の間、本体を繰......うなメソッド(イテレータ)を定義する必要があります。
//emlist[][ruby]{
class Array
def each2
i = 0
while i < self.size
yield self[i], self[i+1]
i += 2
end
end
end
//}
====[a:break] break
//emlist[例][ruby]{
i = 0
while i < 3
print i, "\n"
bre......の戻り値はその引数になります。
====[a:next] next
//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next if line.strip.empty?
print line
end
//}
文法:
next
next val
nextはもっとも内側のループの次の繰り返しにジャ...