種類
- インスタンスメソッド (55)
- 文書 (33)
- 特異メソッド (11)
クラス
-
CSV
:: Table (11) - MatchData (11)
- Matrix (22)
-
RubyVM
:: InstructionSequence (11)
オブジェクト
-
Readline
:: HISTORY (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) - delete (11)
-
delete
_ at (11) - each (22)
-
ruby 1
. 6 feature (11) -
values
_ at (11)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # to _ a -> Array (18125.0) -
self の情報を 14 要素の配列にして返します。
...引数の個数。あるいは以下のよう
な配列。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]
より詳細な情報については、vm_core.h を参照。
: catch_table
例外や制御構造のオ......令とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},... -
Readline
:: HISTORY . delete _ at(index) -> String | nil (193.0) -
index で指定したインデックスの内容をヒストリから削除し、その内容を返します。 該当する index の内容がヒストリになければ、 nil を返します。 index に 0 を指定すると Readline::HISTORY.shift と同様に最初の入力内容を削除します。 また、 -1 は最後の入力内容というように、index に負の値を指定することで、 最後から入力内容を取得することもできます。 index が -1 の場合は Readline::HISTORY.pop と同様に動作します。
...
index で指定したインデックスの内容をヒストリから削除し、その内容を返します。
該当する index の内容がヒストリになければ、 nil を返します。
index に 0 を指定すると Readline::HISTORY.shift
と同様に最初の入力内容を削除し......-1 は最後の入力内容というように、index に負の値を指定することで、
最後から入力内容を取得することもできます。
index が -1 の場合は Readline::HISTORY.pop と同様に動作します。
@param index 削除対象のヒストリのインデックス......を指定します。
@raise NotImplementedError サポートしていない環境で発生します。
例:
require "readline"
Readline::HISTORY.push("foo", "bar", "baz")
Readline::HISTORY.delete_at(1)
p Readline::HISTORY.to_a #=> ["foo", "baz"]... -
MatchData
# values _ at(*index) -> [String] (119.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...した文字列全体を表します。
@param index インデックスを整数またはシンボル(名前付きキャプチャの場合)で 0 個以上指定します。
//emlist[例][ruby]{
m = /(foo)(bar)(baz)/.match("foobarbaz")
# same as m.to_a.values_at(...)
p m.values_at(0, 1, 2, 3, 4)......z", "foo", "bar", "baz", nil]
p m.values_at(-1, -2, -3, -4, -5) # => ["baz", "bar", "foo", nil, nil]
m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
m.to_a # => ["1 + 2", "1", "+", "2"]
m.values_at(:a, :b, :op) # => ["1", "2", "+"]
//}
@see Array#values_at, Array#[]... -
CSV
:: Table # delete(index _ or _ header) -> object (107.0) -
指定された行か列を削除して返します。
...1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.delete(1)
table.to_a # => [["header1", "header2"], ["row1_1", "row1_2"]]
//}
@see CSV::Table#by_col!, CSV::Table#by_row!, CSV::Table#delete_if... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (72.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...[new]
: ((<aStruct#values_at|Struct/values_at>)) [new]
ruby 1.6 の ((<indexes|Array/indexes>)) は、values_at というメソッド
名になりました(ruby 1.7 では block なし ((<select|Array/select>)) が
indexes の代わりでしたが、こちらも使用すると警告が出ま......映された上で obsolete)
# str =~ arg だけは、arg が文字列のとき、
# Regexp.compile(Regexp.quote(arg)) =~ str と等価な str.index(arg) が
# 実行されます(したがって、$~ は設定されません)。
$; の指定に正規表現が許されるようになりま......[change]
((<Time/Time.times>)) から移動しました。
(Time.times も残っていますが、warningが出ます)
: ((<Time#to_a|Time/to_a>)) [change]
: ((<Time#zone|Time/zone>)) [change]
gmtime なタイムゾーンに対して"UTC"を返すようになりました... -
ruby 1
. 6 feature (24.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...返していた
p "foo".slice!(5,10)
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
-:2:in `slice!': index 5 out of string (IndexError)
from -:2
=> ruby 1.6.7 (2002-08-01) [i586-linux]
nil
nil
: 2002-07-05 String#spli......p foo["bar"] = "baz"
p foo
=> ruby 1.6.7 (2002-03-01) [i586-linux]
"baz"
"foo"
=> -:2:in `[]=': string not matched (IndexError)
from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]
: 2002-06-03 sprintf()
"%d" で引数を整数にするときに、((<......Enumerable
def each(&block)
block.call(1,2)
block.call(2,3)
block.call(3,4)
end
end
x = X.new
p x.to_a #=> [[1], [2], [3]]
# => ruby 1.6.3 (2001-03-19) [i586-linux]
[[1], [2], [3]]
# => ruby 1.6.4 (2001-06-04) [i586-linux]... -
NEWS for Ruby 2
. 0 . 0 (18.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...工していないプロファイルデータを返します
* Hash
* 追加: Hash#to_h 明示的に変換するメソッドです。Array#to_a に似ています
* 拡張: Hash#default_proc= default proc をクリアするために nil を渡せるようになりました
* IO
*......は後方互換性のためまだサポートしています。
//emlist{
str.lines.with_index(1) {|line, lineno| ... } # str.lines が配列を返すのでもう動かない
str.each_line.with_index(1) {|line, lineno| ... } # このように each_line に置き換える
//}
* IO#lines, I... -
Matrix
# each(which = :all) -> Enumerator (12.0) -
行列の各要素を引数としてブロックを呼び出します。
...uby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each { |e| puts e }
# => prints the numbers 1 to 4
Matrix[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map... -
Matrix
# each(which = :all) {|e| . . . } -> self (12.0) -
行列の各要素を引数としてブロックを呼び出します。
...uby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each { |e| puts e }
# => prints the numbers 1 to 4
Matrix[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each_with_index, Matrix#map...