別のキーワード
ライブラリ
- ビルトイン (1024)
- abbrev (12)
- csv (24)
- erb (8)
- json (12)
-
json
/ add / bigdecimal (12) -
json
/ add / exception (12) - optparse (36)
- ostruct (14)
-
rexml
/ document (24) -
webrick
/ httprequest (12)
クラス
- Array (68)
- BigDecimal (12)
-
CSV
:: Table (24) - Data (3)
- ERB (8)
-
Encoding
:: Converter (48) - Exception (12)
- Hash (477)
- MatchData (12)
- Method (12)
- Module (12)
- Numeric (12)
- Object (24)
- OpenStruct (14)
- OptionParser (24)
- Proc (6)
-
REXML
:: Attributes (12) -
REXML
:: Element (12) -
RubyVM
:: InstructionSequence (12) - String (228)
- Struct (17)
- UnboundMethod (24)
-
WEBrick
:: HTTPRequest (12)
モジュール
キーワード
- % (12)
- < (10)
- <= (10)
- == (12)
- === (12)
- > (10)
- >= (10)
- abbrev (12)
-
add
_ attributes (12) - assoc (12)
- collect (21)
-
compare
_ by _ identity (12) -
compare
_ by _ identity? (12) - dig (20)
- each (12)
-
each
_ key (12) -
each
_ pair (24) -
each
_ value (12) - encode (36)
- eql? (48)
- equal? (12)
- filter (14)
- filter! (14)
- getopts (36)
-
group
_ by (24) - gsub (48)
- gsub! (48)
- intersection (6)
- invert (12)
-
keep
_ if (19) - map (21)
- member? (12)
- merge (24)
- merge! (24)
-
named
_ captures (12) - namespaces (12)
- owner (12)
-
primitive
_ convert (48) - query (12)
- rehash (12)
- replace (12)
- result (8)
-
ruby2
_ keywords (18) - select (19)
- select! (19)
- store (12)
- sub (36)
- sub! (36)
- tally (10)
-
to
_ a (12) -
to
_ csv (12) -
to
_ h (50) -
to
_ json (36) -
to
_ s (12) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - union (7)
- update (24)
検索結果
先頭5件
-
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (24479.0) -
For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.
...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument......l hash argument is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed thro......er methods.
This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
be... -
Proc
# ruby2 _ keywords -> proc (24479.0) -
Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.
...Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked......ormal argument splat to another method call, and that
method call does not include explicit keywords or a keyword splat, the
final element is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods.
This should only be used for procs that delegate keyword......er
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, be... -
Object
# hash -> Integer (21380.0) -
オブジェクトのハッシュ値を返します。このハッシュ値は、Object#eql? と合わせて Hash クラスで、2つのオブジェクトを同一のキーとするか判定するために用いられます。
...オブジェクトのハッシュ値を返します。このハッシュ値は、Object#eql? と合わせて Hash クラスで、2つのオブジェクトを同一のキーとするか判定するために用いられます。
2つのオブジェクトのハッシュ値が異なるとき、直ち......に Object#eql? での比較により判定されます。
そのため、同じキーとして判定される状況は Object#eql? の比較で真となる場合のみであり、このとき前段階としてハッシュ値どうしが等しい必要があります。
つまり、
A.eql?(B) な......らば A.hash == B.hash
の関係が満たされている必要があります。
ただし、ハッシュのキーとして Integer, Symbol, String などの特定の組み込みクラスが使われるときは、組込みのハッシュ関数が使用され、hash メソッドは呼ばれませ... -
Array
# hash -> Integer (21268.0) -
自身のハッシュ値を整数で返します。ハッシュ値は自身の各要素のハッシュ値から 計算されます。Array#eql? で比較して等しい配列同士は同じハッシュ値を返します。
...ら
計算されます。Array#eql? で比較して等しい配列同士は同じハッシュ値を返します。
//emlist[例][ruby]{
a = ["a", "b", 1]
a.hash #=> 321
b = a.dup
b.hash #=> 321
["a", 1, "b"].hash #=> 491
["a", 1.0, "b"].hash #=> 466227
//}... -
UnboundMethod
# hash -> Integer (21250.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}... -
Hash
# rehash -> self (21231.0) -
キーのハッシュ値を再計算します。
...@raise RuntimeError Hash#eachなどのイテレータの評価途中でrehashすると発生します。
@return selfを返します。
//emlist[例][ruby]{
a = [ "a", "b" ]
h = { a => 100 }
p h[a] #=> 100
a[0] = "z"
p h[a] #=> nil
h.rehash
p h[a] #=> 100
//}
@see Object#hash... -
Hash
# compare _ by _ identity -> self (21225.0) -
ハッシュのキーの一致判定をオブジェクトの同一性で判定するように変更します。
...より厳密に
Object#object_idが一致しているかどうかを条件とするようにselfを変更します。
selfが変化する破壊的メソッドです。
@return selfを返します。
//emlist[例][ruby]{
h1 = { "a" => 100, "b" => 200, :c => "c" }
p h1.compare_by_identity? #=> fals......e
p h1["a"] #=> 100
h1.compare_by_identity
p h1.compare_by_identity? #=> true
p h1["a"] #=> nil # この"a"と最初の"a"とは違うオブジェクト
p h1[:c] #=> "c" # 同じ内容のシンボルはすべて同一
//}
@see Hash#compare_by_identity?... -
Hash
# compare _ by _ identity? -> bool (21219.0) -
ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。
...ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。
//emlist[例][ruby]{
h1 = {}
p h1.compare_by_identity? #=> false
h1.compare_by_identity
p h1.compare_by_identity? #=> true
//}
@see Hash#compare_by_identity... -
Method
# hash -> Integer (18250.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==)
b = method(:eql?)
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}...