ライブラリ
- ビルトイン (1927)
- abbrev (12)
- bigdecimal (12)
-
cgi
/ core (72) -
cgi
/ session (36) -
cgi
/ session / pstore (12) - csv (51)
- date (4)
- dbm (60)
- drb (12)
- erb (16)
- forwardable (48)
- gdbm (72)
- ipaddr (12)
- json (156)
-
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) - matrix (24)
-
minitest
/ unit (1) - mkmf (60)
-
net
/ http (72) -
net
/ imap (24) - open-uri (12)
- openssl (84)
- optparse (36)
- ostruct (60)
- pathname (12)
- pstore (72)
- rake (60)
-
rdoc
/ code _ object (12) -
rdoc
/ context (36) -
rdoc
/ text (12) -
rdoc
/ top _ level (12) -
rexml
/ document (72) -
rexml
/ sax2listener (12) -
rexml
/ streamlistener (12) -
rinda
/ rinda (48) -
rinda
/ tuplespace (60) -
rubygems
/ command (48) -
rubygems
/ commands / dependency _ command (12) -
rubygems
/ config _ file (24) -
rubygems
/ dependency _ list (12) -
rubygems
/ remote _ fetcher (12) -
rubygems
/ source _ index (36) -
rubygems
/ source _ info _ cache (60) -
rubygems
/ spec _ fetcher (24) - sdbm (60)
- set (14)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - sync (12)
- tsort (93)
-
webrick
/ cgi (12) -
webrick
/ httpauth / htdigest (12) -
webrick
/ httpauth / htpasswd (12) -
webrick
/ httprequest (48) -
webrick
/ httpresponse (24) -
webrick
/ server (12) - win32ole (12)
-
yaml
/ dbm (48)
クラス
- Array (113)
- BigDecimal (24)
- Bignum (3)
- CGI (24)
-
CGI
:: Session :: FileStore (12) -
CGI
:: Session :: MemoryStore (12) -
CGI
:: Session :: NullStore (12) -
CGI
:: Session :: PStore (12) -
CSV
:: Row (27) -
CSV
:: Table (24) - Complex (12)
- DBM (60)
-
DRb
:: DRbServer (12) - Data (12)
- Date (14)
- DateTime (14)
- ERB (16)
-
Encoding
:: Converter (48) -
Enumerator
:: ArithmeticSequence (7) - Exception (12)
- Float (12)
- GDBM (72)
-
Gem
:: Command (48) -
Gem
:: Commands :: DependencyCommand (12) -
Gem
:: ConfigFile (24) -
Gem
:: DependencyList (12) -
Gem
:: RemoteFetcher (12) -
Gem
:: SourceIndex (36) -
Gem
:: SourceInfoCache (60) -
Gem
:: SpecFetcher (24) - Hash (1116)
- IPAddr (12)
-
JSON
:: State (24) - KeyError (16)
- MatchData (26)
- Matrix (12)
- Method (12)
-
MiniTest
:: Unit (1) - Module (12)
-
Net
:: IMAP (24) - Numeric (12)
- Object (60)
-
OpenSSL
:: Config (12) -
OpenSSL
:: SSL :: SSLContext (12) -
OpenSSL
:: X509 :: Extension (12) -
OpenSSL
:: X509 :: ExtensionFactory (36) -
OpenSSL
:: X509 :: Name (12) - OpenStruct (72)
- OptionParser (24)
- PStore (72)
- Pathname (12)
- Proc (18)
-
RDoc
:: CodeObject (12) -
RDoc
:: Context (36) -
RDoc
:: Options (12) -
RDoc
:: TopLevel (12) -
REXML
:: Attributes (12) -
REXML
:: DocType (12) -
REXML
:: Element (48) -
Rake
:: TaskArguments (60) - Range (24)
- Rational (24)
- Regexp (36)
-
Rinda
:: TupleEntry (12) -
Rinda
:: TupleSpace (48) -
Rinda
:: TupleSpaceProxy (48) -
RubyVM
:: InstructionSequence (12) - SDBM (60)
- Set (20)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - String (240)
- Struct (59)
- Symbol (12)
- Time (26)
- UnboundMethod (24)
- Vector (12)
-
WEBrick
:: CGI (12) -
WEBrick
:: GenericServer (12) -
WEBrick
:: HTTPAuth :: Htdigest (12) -
WEBrick
:: HTTPAuth :: Htpasswd (12) -
WEBrick
:: HTTPRequest (48) -
WEBrick
:: HTTPResponse (24) - WIN32OLE (12)
-
YAML
:: DBM (48)
モジュール
-
CGI
:: QueryExtension (48) - Enumerable (81)
- 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 (36) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (60)
-
Net
:: HTTPHeader (72) -
OpenURI
:: Meta (12) -
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)
-
cache
_ data (12) - classify (12)
- clear (12)
- clone (12)
- collect (28)
- compact (9)
- compact! (9)
-
compare
_ by _ identity (12) -
compare
_ by _ identity? (12) - config (48)
- 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)
- defaults= (12)
- delegate (24)
- delete (36)
-
delete
_ if (24) - difference (7)
- dig (40)
- dup (12)
- each (96)
-
each
_ key (24) -
each
_ pair (24) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
each
_ value (24) - empty? (12)
- encode (36)
- entities (12)
- eql? (60)
- equal? (12)
- except (4)
- fetch (108)
-
fetch
_ path (12) -
fetch
_ values (20) - files (12)
- filter (14)
- filter! (14)
-
find
_ gems (12) - flatten (12)
-
form
_ data= (12) - getopts (36)
-
group
_ by (24) - gsub (48)
- gsub! (48)
-
has
_ key? (12) -
has
_ value? (12) - hash (265)
-
hash
_ old (12) - header (36)
- include? (12)
- index (7)
- inspect (24)
-
instance
_ delegate (12) - intersection (6)
- invert (48)
- invoke (12)
-
is
_ a? (12) -
keep
_ if (24) - key (20)
- key? (12)
- keys (12)
-
kind
_ of? (12) -
latest
_ cache _ data (12) -
latest
_ specs (12) - length (12)
- map (28)
- member? (12)
- merge (24)
- merge! (24)
- modifiable (12)
-
named
_ captures (24) - namespaces (12)
- out (12)
- owner (12)
- params (12)
- params= (12)
-
primitive
_ convert (48) -
process
_ args (1) - query (12)
- rassoc (12)
- read (24)
-
read
_ all (24) -
read
_ cache _ data (12) - receiver (8)
- rehash (30)
- reject (72)
- reject! (24)
- replace (60)
- reset (8)
-
reset
_ cache _ for (12) - restore (48)
- result (8)
-
result
_ with _ hash (8) -
rm
_ f (12) -
rm
_ rf (12) - root? (12)
- roots (12)
-
ruby2
_ keywords (18) - select (36)
- select! (24)
-
set
_ cache _ data (12) -
set
_ form _ data (12) -
set
_ params (12) - shift (12)
-
show
_ hash (12) -
single
_ delegate (12) - size (12)
- slice (8)
-
spec
_ predecessors (12) - specs (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 (10)
-
to
_ a (24) -
to
_ csv (12) -
to
_ h (120) -
to
_ hash (108) -
to
_ json (252) -
to
_ json _ raw (12) -
to
_ json _ raw _ object (12) -
to
_ proc (10) -
to
_ s (36) -
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) -
try
_ do (24) - tsort (12)
-
tsort
_ each (23) -
type
_ params (12) - union (7)
-
unmatched
_ alias _ lists (12) -
unmatched
_ alias _ lists= (12) - update (48)
- value (12)
- value? (12)
- values (12)
-
values
_ at (12) -
with
_ defaults (12) - write (24)
- xsystem (12)
- | (12)
検索結果
先頭5件
-
Hash
# invert -> Hash (21126.0) -
値からキーへのハッシュを作成して返します。
...備えて、変換後の値を配列として保持するには、次のようにします。
//emlist[][ruby]{
def 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
# reject {|key , value| . . . } -> Hash (21126.0) -
self を複製して、ブロックを評価した値が真になる要 素を削除したハッシュを返します。
...す。
selfを破壊的に変更したい場合はかわりにHash#delete_ifかHash#reject!を使います。
//emlist[例][ruby]{
h = { 2 =>"8" ,4 =>"6" ,6 =>"4" ,8 =>"2" }
p h.reject{|key, value| key.to_i < value.to_i} #=> {6=>"4", 8=>"2"}
//}
@see Hash#delete_if,Hash#delete,Enumerable#reject... -
Hash
# transform _ keys!(hash) -> self (21126.0) -
すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。 値は変化しません。
...すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。
値は変化しません。
@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
@return transform_keys! は常に self を返しま......# => {: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
# slice(*keys) -> Hash (21124.0) -
引数で指定されたキーとその値だけを含む Hash を返します。
...引数で指定されたキーとその値だけを含む Hash を返します。
//emlist[例][ruby]{
h = { a: 100, b: 200, c: 300 }
h.slice(:a) # => {:a=>100}
h.slice(:c, :b) # => {:c=>300, :b=>200}
h.slice(:b, :c, :d) # => {:b=>200, :c=>300}
//}
@see Hash#except, ENV.slice... -
Hash
# transform _ keys {|key| . . . } -> Hash (21120.0) -
すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。 値は変化しません。
...# => {"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 _ values {|value| . . . } -> Hash (21120.0) -
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。
...{ a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", c: "3" }
h.transform_values.with_index {|v, i| "#{v}.#{i}" }
#=> { a: "1.0", b: "2.1", c: "3.2" }
//}
@see Hash#transform_values!
@see Hash#transform_keys
@see Hash#transform_keys!... -
Hash
# slice(*keys) -> Hash (21118.0) -
引数で指定されたキーとその値だけを含む Hash を返します。
...引数で指定されたキーとその値だけを含む Hash を返します。
//emlist[例][ruby]{
h = { a: 100, b: 200, c: 300 }
h.slice(:a) # => {:a=>100}
h.slice(:c, :b) # => {:c=>300, :b=>200}
h.slice(:b, :c, :d) # => {:b=>200, :c=>300}
//}
@see ENV.slice... -
Hash
# filter {|key , value| . . . } -> Hash (21115.0) -
key, value のペアについてブロックを評価し,真となるペアだけを含む ハッシュを生成して返します。
...った場合は、自身と select から生成した
Enumerator オブジェクトを返します。
//emlist[][ruby]{
h = { "a" => 100, "b" => 200, "c" => 300 }
h.select {|k,v| k > "a"} #=> {"b" => 200, "c" => 300}
h.select {|k,v| v < 200} #=> {"a" => 100}
//}
@see Hash#select!, Hash#reject... -
Hash
# select {|key , value| . . . } -> Hash (21115.0) -
key, value のペアについてブロックを評価し,真となるペアだけを含む ハッシュを生成して返します。
...った場合は、自身と select から生成した
Enumerator オブジェクトを返します。
//emlist[][ruby]{
h = { "a" => 100, "b" => 200, "c" => 300 }
h.select {|k,v| k > "a"} #=> {"b" => 200, "c" => 300}
h.select {|k,v| v < 200} #=> {"a" => 100}
//}
@see Hash#select!, Hash#reject... -
Hash
# transform _ values {|value| . . . } -> Hash (21108.0) -
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。
...2, c: 3 }
h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", c: "3" }
h.transform_values.with_index {|v, i| "#{v}.#{i}" }
#=> { a: "1.0", b: "2.1", c: "3.2" }
//}
@see Hash#transform_values!... -
Hash
# clone -> Hash (21103.0) -
selfと同じ内容を持つ新しいハッシュを返します。
selfと同じ内容を持つ新しいハッシュを返します。
clone は frozen singleton-class の情報も含めてコピーしますが、
dup は内容と tainted だけをコピーします。
またどちらのメソッドも要素それ自体のコピーはしません。
つまり参照しているオブジェクトが変わらない「浅い(shallow)」コピーを行います。
//emlist[例][ruby]{
h1 = {"have" => "have a","as" => "as a" }
h2 = h1.dup
h2["have"] = "has"
p h2 #=> {"have"=>"has", "as"=>...selfと同じ内容を持つ新しいハッシュを返します。
clone は frozen singleton-class の情報も含めてコピーしますが、
dup は内容だけをコピーします。
またどちらのメソッドも要素それ自体のコピーはしません。
つまり参照しているオブジェクトが変わらない「浅い(shallow)」コピーを行います。
//emlist[例][ruby]{
h1 = {"have" => "have a","as" => "as a" }
h2 = h1.dup
h2["have"] = "has"
p h2 #=> {"have"=>"has", "as"=>"as a"}
p ... -
Hash
# dup -> Hash (21103.0) -
selfと同じ内容を持つ新しいハッシュを返します。
selfと同じ内容を持つ新しいハッシュを返します。
clone は frozen singleton-class の情報も含めてコピーしますが、
dup は内容と tainted だけをコピーします。
またどちらのメソッドも要素それ自体のコピーはしません。
つまり参照しているオブジェクトが変わらない「浅い(shallow)」コピーを行います。
//emlist[例][ruby]{
h1 = {"have" => "have a","as" => "as a" }
h2 = h1.dup
h2["have"] = "has"
p h2 #=> {"have"=>"has", "as"=>...selfと同じ内容を持つ新しいハッシュを返します。
clone は frozen singleton-class の情報も含めてコピーしますが、
dup は内容だけをコピーします。
またどちらのメソッドも要素それ自体のコピーはしません。
つまり参照しているオブジェクトが変わらない「浅い(shallow)」コピーを行います。
//emlist[例][ruby]{
h1 = {"have" => "have a","as" => "as a" }
h2 = h1.dup
h2["have"] = "has"
p h2 #=> {"have"=>"has", "as"=>"as a"}
p ... -
Hash
# [](key) -> object | nil (21061.0) -
key に関連づけられた値を返します。
...る必要が
ある場合は Hash#fetch または Hash#key? を使ってください。
@param key 探索するキーを指定します。
//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}
p h[:ab] #=> "some"
p h[:ef] #=> nil
h1 = Hash.new("default value")
p h1[:non]......#=> "default value"
h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}
@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc...