2999件ヒット
[1-100件を表示]
(0.103秒)
ライブラリ
- ビルトイン (1571)
- abbrev (12)
-
cgi
/ core (36) - csv (15)
- date (4)
- dbm (36)
- drb (12)
- erb (16)
- forwardable (48)
- gdbm (48)
- ipaddr (12)
- json (120)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / ostruct (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / symbol (12) -
json
/ add / time (12) -
minitest
/ unit (1) - mkmf (60)
-
net
/ http (60) -
net
/ imap (24) - openssl (48)
- optparse (36)
- ostruct (34)
- pstore (72)
- rake (48)
-
rdoc
/ context (24) -
rdoc
/ text (12) -
rdoc
/ top _ level (12) -
rexml
/ document (48) -
rexml
/ sax2listener (12) -
rexml
/ streamlistener (12) -
rinda
/ rinda (48) -
rinda
/ tuplespace (48) -
rubygems
/ command (24) -
rubygems
/ commands / dependency _ command (12) -
rubygems
/ dependency _ list (12) -
rubygems
/ remote _ fetcher (12) -
rubygems
/ source _ index (12) -
rubygems
/ source _ info _ cache (36) - sdbm (36)
- set (5)
- sync (12)
- tsort (93)
-
webrick
/ cgi (12) -
webrick
/ httprequest (24) - win32ole (12)
-
yaml
/ dbm (24)
クラス
- Array (82)
- BigDecimal (12)
- CGI (24)
-
CSV
:: Row (15) - Complex (12)
- DBM (36)
-
DRb
:: DRbServer (12) - Data (6)
- Date (14)
- DateTime (14)
- ERB (16)
-
Encoding
:: Converter (48) - Exception (12)
- GDBM (48)
-
Gem
:: Command (24) -
Gem
:: Commands :: DependencyCommand (12) -
Gem
:: DependencyList (12) -
Gem
:: RemoteFetcher (12) -
Gem
:: SourceIndex (12) -
Gem
:: SourceInfoCache (36) - Hash (1017)
- IPAddr (12)
- KeyError (16)
- MatchData (14)
-
MiniTest
:: Unit (1) -
Net
:: IMAP (24) - Numeric (12)
- Object (48)
-
OpenSSL
:: Config (12) -
OpenSSL
:: X509 :: ExtensionFactory (36) - OpenStruct (46)
- OptionParser (24)
- PStore (72)
-
RDoc
:: Context (24) -
RDoc
:: TopLevel (12) -
REXML
:: Element (48) -
Rake
:: TaskArguments (48) - Range (12)
- Rational (24)
- Regexp (12)
-
Rinda
:: TupleSpace (48) -
Rinda
:: TupleSpaceProxy (48) - SDBM (36)
- Set (8)
- String (240)
- Struct (28)
- Symbol (12)
- Time (26)
-
WEBrick
:: CGI (12) -
WEBrick
:: HTTPRequest (24) - WIN32OLE (12)
-
YAML
:: DBM (24)
モジュール
-
CGI
:: QueryExtension (12) - Enumerable (55)
- Forwardable (24)
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (24) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (60)
-
Net
:: HTTPHeader (60) -
OptionParser
:: Arguable (12) -
RDoc
:: Text (12) -
REXML
:: SAX2Listener (12) -
REXML
:: StreamListener (12) - SingleForwardable (24)
-
Sync
_ m (12) - TSort (93)
キーワード
- % (12)
- < (10)
- << (12)
- <= (10)
- == (12)
- === (12)
- > (10)
- >= (10)
- [] (24)
- []= (36)
- abbrev (12)
-
add
_ attributes (12) -
add
_ class _ or _ module (24) -
add
_ element (12) -
add
_ specs (12) - assoc (12)
- attributes (12)
- clone (12)
- collect (28)
- compact (9)
- compact! (9)
-
compare
_ by _ identity (12) -
compare
_ by _ identity? (12) - config (24)
- context (12)
- context= (12)
-
create
_ ext _ from _ hash (12) -
create
_ extension (24) -
deconstruct
_ keys (20) - default (24)
- default= (12)
-
default
_ proc (12) -
default
_ proc= (12) - defaults= (12)
- delegate (24)
- delete (36)
-
delete
_ if (24) - difference (7)
- dig (40)
- dup (12)
- each (36)
-
each
_ key (24) -
each
_ pair (24) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
each
_ value (24) - encode (36)
- eql? (60)
- equal? (12)
- except (4)
- fetch (108)
-
fetch
_ path (12) -
fetch
_ values (20) - filter (14)
- filter! (14)
-
find
_ gems (12) - flatten (12)
-
form
_ data= (12) - getopts (36)
- gsub (48)
- gsub! (48)
-
has
_ key? (12) -
has
_ value? (12) - header (12)
- include? (12)
- index (7)
- inspect (12)
-
instance
_ delegate (12) - intersection (6)
- invert (12)
- invoke (12)
-
is
_ a? (12) -
keep
_ if (24) - key (20)
- key? (12)
- keys (12)
-
kind
_ of? (12) - map (28)
- member? (12)
- merge (24)
- merge! (24)
- modifiable (12)
-
named
_ captures (12) - out (12)
- params= (12)
-
primitive
_ convert (48) -
process
_ args (1) - rassoc (12)
- read (24)
-
read
_ all (24) -
read
_ cache _ data (12) - receiver (8)
- rehash (12)
- reject (60)
- reject! (24)
- replace (60)
- reset (8)
-
reset
_ cache _ for (12) - result (8)
-
result
_ with _ hash (8) -
rm
_ f (12) -
rm
_ rf (12) - root? (12)
- roots (12)
- select (36)
- select! (24)
-
set
_ cache _ data (12) -
set
_ form _ data (12) - shift (12)
-
single
_ delegate (12) - slice (8)
-
spec
_ predecessors (12) -
start
_ element (12) - starttls (24)
- store (12)
-
strip
_ hashes (12) -
strongly
_ connected _ components (12) - sub (36)
- sub! (36)
-
sync
_ sh _ locker (6) -
sync
_ sh _ locker= (6) -
tag
_ start (12) - take (24)
- tally (8)
-
to
_ a (12) -
to
_ h (33) -
to
_ hash (12) -
to
_ json (252) -
to
_ json _ raw (12) -
to
_ s (12) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) -
try
_ do (24) - tsort (12)
-
tsort
_ each (23) - union (7)
-
unmatched
_ alias _ lists= (12) - update (48)
- value? (12)
- values (12)
-
values
_ at (12) -
with
_ defaults (12) - write (24)
- xsystem (12)
- | (12)
検索結果
先頭5件
-
Object
# hash -> Integer (18208.0) -
オブジェクトのハッシュ値を返します。このハッシュ値は、Object#eql? と合わせて Hash クラスで、2つのオブジェクトを同一のキーとするか判定するために用いられます。
...オブジェクトのハッシュ値を返します。このハッシュ値は、Object#eql? と合わせて Hash クラスで、2つのオブジェクトを同一のキーとするか判定するために用いられます。
2つのオブジェクトのハッシュ値が異なるとき、直ち......eql?(B) ならば A.hash == B.hash
の関係が満たされている必要があります。
ただし、ハッシュのキーとして Integer, Symbol, String などの特定の組み込みクラスが使われるときは、組込みのハッシュ関数が使用され、hash メソッドは呼......します。
@return ハッシュ値を返します。Ruby 内部の固定長整数 fixnum に収まらない場合は切り捨てられます。
//emlist[][ruby]{
p self.hash #=> 2013505522753096494
p 0.hash #=> 2647535320520409998
p 0.0.hash #=> -2975129765814025835
p nil.hash #=> 240153142... -
Data
# hash -> Integer (18132.0) -
自身のハッシュ値を整数で返します。 Data#eql? で比較して等しいオブジェクトは同じハッシュ値を返します。
.../emlist[例][ruby]{
Dog = Data.define(:name, :age)
dog1 = Dog.new("Fred", 5)
p dog1.hash # => -3931425561194935428
dog2 = Dog.new("Fred", 5)
p dog2.hash # => -3931425561194935428
dog3 = Dog.new("Fred", 6)
p dog3.hash # => -4469132459285820530
//}
[注意] 本メソッドの記述は Data のサブ......クラスのインスタンスに対して呼び
出す事を想定しています。Data.define は Data のサブクラスを作成する点に
注意してください。
@see Object#hash... -
String
# hash -> Integer (18132.0) -
self のハッシュ値を返します。 eql? で等しい文字列は、常にハッシュ値も等しくなります。
...self のハッシュ値を返します。
eql? で等しい文字列は、常にハッシュ値も等しくなります。
//emlist[例][ruby]{
"test".hash # => 4038258770210371295
("te" + "st").hash == "test".hash # => true
//}
@see Hash... -
Rational
# hash -> Integer (18120.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
@return ハッシュ値を返します。
@see Object#hash... -
Time
# hash -> Integer (18120.0) -
self のハッシュ値を返します。
...self のハッシュ値を返します。
@return ハッシュ値を返します。
@see Object#hash... -
IPAddr
# hash -> Integer (18114.0) -
ハッシュ値を返します。
...ハッシュ値を返します。
@see Object#hash... -
Hash
# to _ hash -> self (15156.0) -
self を返します。
...self を返します。
//emlist[例][ruby]{
hash = {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}
@see Object#to_hash, Hash#to_h... -
Hash
# rehash -> self (15131.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 Obje... -
Hash
# transform _ keys(hash) -> Hash (9252.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。
値は変化しません。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.......") # => {"a"=>1, :b=>2, :c=>3}
h.transform_keys(&:to_s) # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys.with_index {|k, i| "#{k}.#{i}" }
# => {"a.0"=>1, "b.1"=>2, "c.2"=>3}
//}
@see Hash#transform_keys!
@see Hash#transform_values
@see Hash#transform_values!... -
Hash
# to _ h -> self | Hash (9213.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] } #......=> {"A"=>65, "B"=>66}
//}
@see Enumerable#map... -
Hash
# to _ h {|key , value| block } -> Hash (9213.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] } #......=> {"A"=>65, "B"=>66}
//}
@see Enumerable#map...