ライブラリ
- ビルトイン (942)
- abbrev (11)
- bigdecimal (11)
-
cgi
/ core (55) -
cgi
/ session (33) -
cgi
/ session / pstore (11) - csv (22)
- dbm (22)
- drb (11)
- erb (14)
- forwardable (33)
- gdbm (22)
- ipaddr (11)
- json (121)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (11) - matrix (22)
-
minitest
/ unit (1) - mkmf (55)
-
net
/ http (66) -
net
/ imap (22) - open-uri (11)
- openssl (55)
- optparse (33)
- ostruct (54)
- pathname (11)
- pstore (55)
- rake (55)
-
rdoc
/ context (33) -
rdoc
/ text (11) -
rdoc
/ top _ level (11) -
rexml
/ document (66) -
rexml
/ sax2listener (11) -
rexml
/ streamlistener (11) -
rinda
/ rinda (44) -
rinda
/ tuplespace (55) -
rubygems
/ command (11) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ dependency _ list (11) -
rubygems
/ remote _ fetcher (11) -
rubygems
/ source _ index (33) -
rubygems
/ source _ info _ cache (55) - sdbm (11)
-
shell
/ command-processor (6) - sync (12)
- tsort (74)
-
webrick
/ cgi (11) -
webrick
/ httpresponse (22) -
webrick
/ server (11) - win32ole (11)
-
yaml
/ dbm (11)
クラス
- Array (72)
- BigDecimal (22)
- Bignum (3)
- CGI (11)
-
CGI
:: Session :: FileStore (11) -
CGI
:: Session :: MemoryStore (11) -
CGI
:: Session :: NullStore (11) -
CGI
:: Session :: PStore (11) -
CSV
:: Table (22) - Complex (11)
- DBM (22)
-
DRb
:: DRbServer (11) - Data (4)
- Date (11)
- DateTime (11)
- ERB (14)
-
Encoding
:: Converter (44) -
Enumerator
:: ArithmeticSequence (6) - Exception (11)
- Float (11)
- GDBM (22)
-
Gem
:: Command (11) -
Gem
:: Commands :: DependencyCommand (11) -
Gem
:: DependencyList (11) -
Gem
:: RemoteFetcher (11) -
Gem
:: SourceIndex (33) -
Gem
:: SourceInfoCache (55) - Hash (343)
- IPAddr (11)
- MatchData (22)
- Matrix (11)
- Method (11)
-
MiniTest
:: Unit (1) - Module (5)
-
Net
:: IMAP (22) - Numeric (11)
- Object (11)
-
OpenSSL
:: SSL :: SSLContext (11) -
OpenSSL
:: X509 :: ExtensionFactory (33) -
OpenSSL
:: X509 :: Name (11) - OpenStruct (65)
- OptionParser (22)
- PStore (55)
- Pathname (11)
- Proc (11)
-
RDoc
:: Context (33) -
RDoc
:: Options (11) -
RDoc
:: TopLevel (11) -
REXML
:: Attributes (11) -
REXML
:: DocType (11) -
REXML
:: Element (44) -
Rake
:: TaskArguments (55) - Range (22)
- Rational (22)
- Regexp (33)
-
Rinda
:: TupleEntry (11) -
Rinda
:: TupleSpace (44) -
Rinda
:: TupleSpaceProxy (44) -
RubyVM
:: InstructionSequence (11) - SDBM (11)
-
Shell
:: CommandProcessor (6) - String (220)
- Struct (31)
- Symbol (11)
- Time (22)
- UnboundMethod (22)
- Vector (11)
-
WEBrick
:: CGI (11) -
WEBrick
:: GenericServer (11) -
WEBrick
:: HTTPResponse (22) - WIN32OLE (11)
-
YAML
:: DBM (11)
モジュール
-
CGI
:: QueryExtension (44) - Enumerable (71)
- Forwardable (11)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kernel (55)
-
Net
:: HTTPHeader (66) -
OpenURI
:: Meta (11) -
OptionParser
:: Arguable (11) -
RDoc
:: Text (11) -
REXML
:: SAX2Listener (11) -
REXML
:: StreamListener (11) - SingleForwardable (22)
-
Sync
_ m (12) - TSort (74)
キーワード
- % (11)
- [] (11)
- []= (11)
- abbrev (11)
-
add
_ attributes (11) -
add
_ class _ or _ module (22) -
add
_ element (11) -
add
_ specs (11) - assoc (11)
-
cache
_ data (11) - collect (24)
-
compare
_ by _ identity (11) -
compare
_ by _ identity? (11) - config (44)
- context (11)
- context= (11)
-
create
_ ext _ from _ hash (11) -
create
_ extension (22) -
deconstruct
_ keys (2) -
default
_ proc (11) - delegate (11)
- delete (11)
-
delete
_ if (11) - difference (6)
- dig (27)
- each (44)
-
each
_ key (11) -
each
_ pair (11) -
each
_ strongly _ connected _ component (21) -
each
_ strongly _ connected _ component _ from (21) -
each
_ value (11) - encode (33)
- entities (11)
- eql? (33)
- fetch (55)
-
fetch
_ path (11) - files (11)
- filter (6)
- filter! (12)
-
find
_ gems (11) - flatten (11)
-
form
_ data= (11) - getopts (33)
-
group
_ by (22) - gsub (44)
- gsub! (44)
-
hash
_ old (11) - header (22)
- inspect (22)
-
instance
_ delegate (11) - intersection (5)
- invert (44)
- invoke (11)
-
keep
_ if (11) -
latest
_ cache _ data (11) - length (11)
- map (24)
- modifiable (11)
-
named
_ captures (22) - namespaces (11)
- owner (11)
- params (11)
- params= (11)
-
primitive
_ convert (44) -
process
_ args (1) - rassoc (11)
- read (22)
-
read
_ all (22) -
read
_ cache _ data (11) - rehash (6)
- reject (22)
- reject! (22)
-
reset
_ cache _ for (11) - restore (44)
- result (7)
-
result
_ with _ hash (7) -
rm
_ f (11) -
rm
_ rf (11) - root? (11)
-
ruby2
_ keywords (5) - select (22)
- select! (17)
-
set
_ cache _ data (11) -
set
_ form _ data (11) -
set
_ params (11) -
show
_ hash (11) -
single
_ delegate (11) - size (11)
-
spec
_ predecessors (11) -
start
_ element (11) - starttls (22)
-
strip
_ hashes (11) -
strongly
_ connected _ components (11) - sub (33)
- sub! (33)
-
sync
_ sh _ locker (6) -
sync
_ sh _ locker= (6) -
tag
_ start (11) - take (22)
- tally (8)
-
to
_ a (11) -
to
_ csv (11) -
to
_ h (29) -
to
_ hash (11) -
to
_ json (231) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) -
to
_ s (33) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) -
try
_ do (22) -
tsort
_ each (21) -
type
_ params (11) - union (6)
-
unmatched
_ alias _ lists (11) -
unmatched
_ alias _ lists= (11) - value (11)
-
with
_ defaults (11) - write (22)
- xsystem (11)
検索結果
先頭5件
-
Hash
# hash -> Integer (27314.0) -
自身が保持するキーと値のハッシュ値を元にして算出した整数を返します。 自身が保持するキーや値が変化すればこのメソッドが返す値も変化します。
...自身が保持するキーと値のハッシュ値を元にして算出した整数を返します。
自身が保持するキーや値が変化すればこのメソッドが返す値も変化します。
//emlist[例][ruby]{
a = {}
p a.hash #=> 0
a[1] = :x
p a.hash #=> 329543
//}... -
String
# hash -> Integer (24326.0) -
self のハッシュ値を返します。 eql? で等しい文字列は、常にハッシュ値も等しくなります。
...self のハッシュ値を返します。
eql? で等しい文字列は、常にハッシュ値も等しくなります。
//emlist[例][ruby]{
"test".hash # => 4038258770210371295
("te" + "st").hash == "test".hash # => true
//}
@see Hash... -
Range
# hash -> Integer (24314.0) -
始端と終端のハッシュ値と Range#exclude_end? の値からハッシュ値を計算して整数として返します。
...始端と終端のハッシュ値と Range#exclude_end? の値からハッシュ値を計算して整数として返します。
//emlist[例][ruby]{
p (1..2).hash # => 5646
p (1...2).hash # => 16782863
//}... -
Rational
# hash -> Integer (24308.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
@return ハッシュ値を返します。
@see Object#hash... -
Enumerator
:: ArithmeticSequence # hash -> Integer (24302.0) -
自身のハッシュ値を返します。
...自身のハッシュ値を返します。
begin, end, step, exclude_end? が等しい Enumerable::ArithmeticSequence は
同じハッシュ値を返します。... -
OpenStruct
# hash -> Integer (24302.0) -
self のハッシュ値を返します。
self のハッシュ値を返します。 -
Hash
# transform _ keys(hash) -> Hash (21428.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys(a: "a", d: "d") # => {"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
# transform _ keys -> Enumerator (21328.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys(a: "a", d: "d") # => {"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
# transform _ keys {|key| . . . } -> Hash (21328.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys(a: "a", d: "d") # => {"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!... -
Array
# hash -> Integer (21326.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
//}... -
Hash
# invert -> Hash (21326.0) -
値からキーへのハッシュを作成して返します。
...st[例][ruby]{
h = { "a" => 0, "b" => 100, "c" => 200, "d" => 300, "e" => 300 }
p h.invert #=> {0=>"a", 100=>"b", 200=>"c", 300=>"e"}
//}
=== 参考
値が重複していたときに備えて、変換後の値を配列として保持するには、次のようにします。
//emlist[][ruby]{
de......f safe_invert(orig_hash)
orig_hash.each_key.group_by do |key|
orig_hash[key]
end
end
p safe_invert({"a"=>1, "b"=>1, "c"=>3}) # => {1=>["a", "b"], 3=>["c"]}
//}
@see Hash#key... -
Hash
# transform _ keys! -> Enumerator (21326.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby......]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys! {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys!(&:to_sym) # => {:a=>1, :b=>2, :c=>3}
h.transform_keys!(a: "a", d: "d") # => {"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
# transform _ keys!(hash) -> self (21326.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby......]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys! {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
h.transform_keys!(&:to_sym) # => {:a=>1, :b=>2, :c=>3}
h.transform_keys!(a: "a", d: "d") # => {"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
# transform _ keys -> Enumerator (21320.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_keys {|k| k.to_s } # => {"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#transfor......m_keys!
@see Hash#transform_values
@see Hash#transform_values!...