種類
- インスタンスメソッド (458)
- モジュール関数 (88)
- 特異メソッド (86)
- クラス (11)
- オブジェクト (11)
ライブラリ
- ビルトイン (654)
クラス
-
Encoding
:: Converter (44) - Hash (268)
- KeyError (14)
- Method (11)
- Module (5)
- Numeric (11)
- Object (33)
- Proc (11)
-
RubyVM
:: InstructionSequence (55) - String (55)
- Struct (4)
- UnboundMethod (11)
キーワード
- < (9)
- <= (9)
- == (11)
- === (11)
- > (9)
- >= (9)
- ENV (11)
- Hash (11)
- [] (1)
-
compare
_ by _ identity (11) -
compare
_ by _ identity? (11) - compile (11)
-
compile
_ file (11) -
compile
_ option (11) -
compile
_ option= (11) - empty? (11)
- encode (33)
- eql? (44)
- equal? (11)
- filter! (12)
-
has
_ key? (11) -
has
_ value? (11) - include? (11)
-
is
_ a? (11) -
keep
_ if (22) - key (7)
- key? (11)
-
kind
_ of? (11) -
latest
_ gc _ info (22) - member? (11)
- new (14)
-
primitive
_ convert (44) - receiver (7)
-
ruby2
_ keywords (5) -
ruby2
_ keywords _ hash? (5) - select! (22)
- spawn (44)
- system (44)
-
to
_ h (17) -
to
_ hash (11) - value? (11)
検索結果
先頭5件
-
String
# hash -> Integer (26131.0) -
self のハッシュ値を返します。 eql? で等しい文字列は、常にハッシュ値も等しくなります。
...self のハッシュ値を返します。
eql? で等しい文字列は、常にハッシュ値も等しくなります。
//emlist[例][ruby]{
"test".hash # => 4038258770210371295
("te" + "st").hash == "test".hash # => true
//}
@see Hash... -
Method
# hash -> Integer (26125.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
//}... -
UnboundMethod
# hash -> Integer (26125.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
//}... -
Proc
# hash -> Integer (26107.0) -
self のハッシュ値を返します。
...est, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters # => x], [:opt, :y], [:rest, :other
prc = proc{|x, y=42, *other|}
p prc.parameters(lambda: true) # => x], [:opt, :y], [:rest, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters(lambda: false) # => x], [:opt, :y], [:rest, :other
//}... -
Hash
. ruby2 _ keywords _ hash?(hash) -> bool (23220.0) -
Module#ruby2_keywordsやProc#ruby2_keywordsによる ruby2_keywords フラグが設定されているかどうかを返します。
...れていません。
ruby 2.7.1 で追加されたため、ruby 2.7.0 では定義されていません。
//emlist[][ruby]{
ruby2_keywords def foo(*args)
Hash.ruby2_keywords_hash?(args.last)
end
foo(k: 1) # => true
foo({k: 1}) # => false
//}
@see Module#ruby2_keywords, Proc#ruby2_keywords... -
Hash
# to _ hash -> self (23155.0) -
self を返します。
...self を返します。
//emlist[例][ruby]{
hash = {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}
@see Object#to_hash, Hash#to_h... -
Hash
# to _ h -> self | Hash (17212.0) -
self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。
...す。Hash クラスのサブクラスから呼び出した場合は
self を Hash オブジェクトに変換します。
//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true
class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.clas......s # => MyHash
p my_hash.to_h.class # => Hash
//}
ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } #... -
Hash
# to _ h {|key , value| block } -> Hash (17212.0) -
self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。
...す。Hash クラスのサブクラスから呼び出した場合は
self を Hash オブジェクトに変換します。
//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true
class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.clas......s # => MyHash
p my_hash.to_h.class # => Hash
//}
ブロックを指定すると各ペアでブロックを呼び出し、
その結果をペアとして使います。
//emlist[ブロック付きの例][ruby]{
hash = { "a" => 97, "b" => 98 }
hash.to_h {|key, value| [key.upcase, value-32] } #... -
Hash
# to _ h -> self | Hash (17199.0) -
self を返します。Hash クラスのサブクラスから呼び出した場合は self を Hash オブジェクトに変換します。
...す。Hash クラスのサブクラスから呼び出した場合は
self を Hash オブジェクトに変換します。
//emlist[例][ruby]{
hash = {}
p hash.to_h # => {}
p hash.to_h == hash # => true
class MyHash < Hash;end
my_hash = MyHash.new
p my_hash.to_h # => {}
p my_hash.clas......s # => MyHash
p my_hash.to_h.class # => Hash
//}... -
Hash
# <=(other) -> bool (17036.0) -
self が other のサブセットか同じである場合に真を返します。
...セットか同じである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 <= h2 # => true
h2 <= h1 # => false
h1 <= h1 # => true
//}
@see Hash#<, Hash#>=, Hash#>... -
Hash
# >=(other) -> bool (17036.0) -
other が self のサブセットか同じである場合に真を返します。
...セットか同じである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 >= h2 # => false
h2 >= h1 # => true
h1 >= h1 # => true
//}
@see Hash#<=, Hash#<, Hash#>... -
Hash
# <(other) -> bool (17030.0) -
self が other のサブセットである場合に真を返します。
...サブセットである場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 < h2 # => true
h2 < h1 # => false
h1 < h1 # => false
//}
@see Hash#<=, Hash#>=, Hash#>...